#blueprint
1 messages · Page 338 of 1
print strings will show the issue
It looks like the gets are correct based on the prints strings
I've unplugged the clearing
print the recipe
make sure the strings match
use contrast
print recipe before the sequence
then print all three
this will show the issue
Alright, it looks like it didn't go down the false branches this time
i don't see the recipe string ?
is it populated correctly ?
make sure the map key matches exactly
when you set it and get it
but something seems to be wrong with your setting
i would first check by setting the recipe manually to something like "testing"
in the functioin
see if it's the random generation or the actual function
It's your RHI thread. AKA Renderthread.
what do you think is causing it to be like it is cause it's not all the time it's as you see on the mid spike
The random potions are working
weird it didn't print in the other function ?
Cause i dont even have a lot that renders at the point so
This one?
Oh wait bare with
I think its because the create recipe function was on 5 button instead of begin play
ya and if you didn't press 5 then it wouldn't work
i would print all the gets out of the trues now
and now you can see if there was supposed to be a match
because if you think about it, it's random, so you may not get any matches
but if you manually look and see, then you can tell if it's working
so what you can do is try it with the matches, try it without
nothing prints on trues, I'd imagine thats because there is no matches
right
Uncertain. You could try enabling StatNamedEvents and maybe even RenderCommands to see if it'll give any more info on those parts.
I got a match of 1 this time
i didn't mean on trues, my fault, i meant do it before the branch
yes it's working
Cool! do you still want me to do this?
so i did have stats named events on
no print string is np if it works you don't need it
but print the recipe
and the total matches
and select the stuff in the recipe in your slots
see if the number aligns correctly with what you have
Nice I have just tried it and it works.
Now instead of only checking against the health potion ingredients, I need to check against all recipes
I dunno then. You'd have to poke around the rendering channels maybe and see if you can get lucky with anyone who knows what that might be. All I can find is a random mention about particles, but it's obscure and there's no replies to it. 🤷♂️
a for each loop?
why would you need to do that ?
so i do have particles after the move to is completed but I wouldn't see why that would cause the frame spike
Currently we're only checking against the health potion is successful
also there isn't a rendering channel
probably foreach with break
then if you hit your totalMatch on the recipe just break out and thats a match
instead of wasting cycles
best case it's like O(1), worst case O(N) i think, i'm just thinking logically
you could get first and break
or have to loop through all and break at end
nope
you know where the last sequence part is comming out ?
do you want all matches, or just one ?
yeah, so do some sort of check is 2 or 3?
yes
What do you mean?
and if it is, then you know the recipe is what you want
like get the first matching recipe ?
or they are all unique ?
They're all unique recipes but there would be a problem if for example:
Potion: Moss, Sap
Potion 2: Moss, Sap, Jam
this is why like i mentioned already you should store that variable in the struct
@maiden wadi I've made a interesting find which is the particles I have which being just before the frame spike if I don't call them to start there is no frame spike
which means question is why would doing this cause the frame spike to occur
well for one thing, it's not connected to any execution
so it won't be doing anything anytime soon
how often does this run ?
That's a pretty broad question. Spawning a particle does a lot of stuff technically. So it's hard to say.
there just basic sprite and I'm only doing a spawn rate of 95
maybe if I try lerping up the spawn rate would it do anything different but my system should easily handle 95 spawn rate particles
I'm not sure how to do that
TBF, keep in mind that the engine is in kind of a rework of the rendering systems right now. So things that should work may be buggy in weird ways. Specially if you can reproduce it in a basic project it might be worth giving to Epic for them to look at.
first thing you do is go in your struct and create a variable
call it something like total
or count
now in your function that you create a random one, what does that look like ?
so this won't work as is btw
your pulling random twice
it's a pure node, so it will re run both times
so your not removing the correct recipe
you can fix this by caching the variable
after the random, promote that to a variable
and then use that to add, and remove
but to solve the problem of the total, you need to split into array the random that you cache, and then get that arrays length
store that in the total value
split it by +
Like this? I'm not sure what you mean by +
no not like that ...
basically you use + between each one correct ?
you can use this to count how many there are
you parse it into an array that is split by +
then the length is how many in the array
Got you
ok so now in the other function where your matching the recipe to slots, show that again ?
it should show the new struct value
and you want to check if totalMatches is equal to the total in the struct value
yes it shows the total now you see the new value ?
print string that value after the recipe
make sure it matches
3 or 2
with stuff like this you need to test it, might need to add one, subtract one
printing the total off the struct value from the map, should show you how many ingredients are in the recipe
This is only printing 1 when I match the ingredients
print the recipe, and print the number
see what matches up
^
interesting
can you restart the project ?
i don't see anything right off the bat, but i'm probably overlooking something
Sure
and these two are when you press the key ?
thats wild it should be generated
make sure in this parse into array, there are no spaces just the +
That's my b then, there is spaces
I'll try it without
Works😅
nice
so now you say, if totalMatches == thisNewTotalNumber
then you have a match
and bingo bango you got yourself a recipe finder
and this will work with any amount of ingredients as well
Nice! Now I just need to run it through the loop
but this is going to be shitty with 650 things
loops are horrible in bp
just as a heads up, you may want to offload some of these loops to c++ if possible
ブループリントとC++のパフォーマンスの比較をしてみました。ブループリントのネイティブ化をした結果も動画の後半に載せています。
I tried to compare the performance of blueprint and C++. Blueprint Nativization is posted in the latter half of the movie.
Thanks man, I truly appreciate all you've done
Can you just confirm this for each loop is correct?
Cool, and is there a way to print which potion it has created?
Currently only printing hello
yes drag from the recipe, and you also want a break to make it more efficient
here the recipe in the struct value is the one that is selected and is a match
so then you break
and on completed get that value
and if at the end you didn't find anything then just default with something else
like set a variable thisSTring, set it to a default, on true, set thisSTring, break
return thisSTring
Sorry, I'm a little lost, currently from what I can gather, this is what I have but this will only print the recipe rather than the name of the potion the recipe belongs to
array element is the key for the map
the recipe is the recipe
but see where you pull from array element and use that in the find
thats the key to the map that holds that recipe
so basically array element is what your looking for, this is the potion name
test this by generating a bunch of random names in the array before you populate, see how efficient it runs
try 50
200
500
1000
Hey all, not sure where to put this, but I figure Blueprint is a good place to start.
I'm trying to integrate rotation into a node-based path following behavior (in this case, using StateTree, but it's probably applicable to Behavior Trees as well)
I want the an actor to do this via the behavior system:
- ANIMATE a rotation (like a tank turret) to face next path node
- Wait 3 seconds
- Move to next path node
- Wait 3 seconds
Repeat
The problem is, while it is easy enough to integrate a latent 'AI Move To" node into the behavior setup, there is no latent equivalent of "Face Actor".
There is only a "Set Rotation" which is instantaneous.
You also can't create a true "tick" function nor a timeline in behavior / state tree graphs, so I can't evne animate it that way.
If anybody has any idea how I could pull this off a smooth animated rotation in a behavior sequence, I'd greatly appreciate it.
I made a BTT called rotate to actor. Rotates the actor towards a blackboard value. You could use an array and set the next value before getting to the node.
It works but something is slightly off, in this video I attempt to make a health potion (using health potion ingredients) but when crafted, it prints Mana Potion
try a foreach with break
and break when you get the match
it may be possible you have two ingredients that make something else
and after it finds the first, it also finds the second later on in the loop
so a break would solve this problem
because it would stop looping once it finds the result
I've added a break but now I get Poison when trying to craft a health potion
Looking at the recipe on the print string, they both contain Ashen Beetle and Moon Cap for the health and poison recipes (hp 2 match, poison 3 match)
i noticed this as well
print the total
of each recipe?
what do you use for empty ?
as far as in the map
when it get zero on an empty slot what does it get ?
it should be a default like empty or something, something that will never show up in the list
something that when matched against will give a false
Worth noting I get these errors, I believe these are to do with empty
you can check if the index is valid, or set empty to actually be some default like literally "empty"
Also it's printing correctly
yes this isn't the problem, the problem is get zero of empty
everything in the recipe generation is fine for sure
the problem is you are getting zero of a non existing slot value
if that makes sense
there is no get 0
zero index doesn't exist
so you can do the two things i mentioned
I understand, so do I put a default value there on zero and change the gets to 1?
no don't change the gets
If I add a value to the slots so 0 is always valid, I'd need to change the gets to 1 as it's adding no?
i would just do an AND is valid index on each one
makes things simple
so drag out from the keys on each one and do is valid index
check that zero is valid
on each one
before you get them
no if there is none adding one will make the first one zero
arrays are zero index
so 0,1,2,3,4,etc...
It'd be 3 different branches right? not this
you need to check if it's valid before you get, so check before the other branches for each one
if is valid
then true, check if it matches
if false just do nothing don't add
so if it's invalid it won't add anything
okay so in the UE5 Channel found out what was causing my issue, so each time I do a standalone game i'm not giving it to time to do the PSO stuff so when that Niagara particle starts the stutter is the shaders being done for it now question is whats best way to deal with this PSO issue cause I'd need to at game being launched hold off on game progressing until well stuff is done
Thanks! Does your BTT that rotates actually animate the rotation? So far I can only get snap rotations.
but not sure if I can do that without well a level being loaded
yes three at the top right before your other branches, think about when the pure nodes get, they get when they are needed, so if you check if it's valid, and do nothing if it's invalid, then it won't get zero because you don't pull it for the next branch
@lofty rapids Like this?
no not at all
put them in the matching green places
so you check if it's valid, before you pull from those values
or else you'll keep getting the error
the way you have it set up breaks the whole thing if there is an empty value
If you mean it's an actual animation or are you using a mesh on top of the tank? You can do anything you want inside of a BTT. You could slowly rotate it based on Delta... Get its current rotation add a value and then set the rotation.
It's no different from rotating anything.
Got it
Ah, it's possible that BTT's are different than StateTrees then. There is no ability to operate on tick or an animation timeline within StateTree functions.
I do realize this is very easy to do in an actor BP for example since I'd just use the tik and an Rinterp / Rotate combo, but this is not possible in a StateTree.
Are you doing your BTT rotation on a tick function?
yes exactly this should fix it
It works but still getting the errors
show where your pulling from ?
i see you have wires going up
where do they attach to ?
whats on the left side of the image ?
click where it says branch, where does it take you to ?
What do you mean
thats strange it shouldn't be accesing zero if it's not valid
in the error, literally "click where it says branch"
it should take you to the node
that is running
that is the issue
No tick. Just grabbing current rotation and adding to it untils at the desired rotation. If state trees work differently then couldn't you just call a function in the tank called rotate turret? And put a speed and a desired end rotation? Then the tank handles it itself
They both lead to this branch
oh i see
your lines are not correctly ordered
your top lines don't align properly with your bottom lines
does that make sense ?
your not checking the correct keys zero
Ohh on the gets?
yes
the same ones
so that you check if it's valid, then if it is, then you can get it
if your not matched up it won't work correctly
i been programming a long time, unreal for awhile now, but i took a few breaks
You're still sharp haha
i've made a few games now like 4 or 5 little projects, i understand blueprints pretty well
i really like the visual programming aspect of it
it's new to me i'm use to writing code
but i always like visual, even visual basic i like that language
because it's visual you just drag and drop
blueprints is really fun to use imo
just a lot of click and dragging
lol
Yeah haha, I like the visual code unreal engine gives. I can read code but I'm not great at writing it. Have you got any projects/games I could check out?
this is what i'm recently working on
theres also this ^
but thats about as much as i can post without getting blasted for self promotion
the golf game is the newest project, i got a bunch of videos of different projects
i'm having fun with it
Nice projects! You should stick to it, you're very knowledgable, you could easily create some good stuff
the plan is to eventually make a good game sell it, but i'm just still messing around learning not sure of what kind of game to make that will be good and sell
i think eventually i will get something like i have seen other people who make games they had to make a few games to get something good out of everything they learned
because of my programming history blueprints just makes a lot of sense to me
i use minimal c++ when i need too
I think go in with the mindset of creating a game that you've always wanted to create rather than going in with the idea of satisfying customers. Easy way to burn out by going in with satisfying expectations of others
I've been through so many projects and burnt out because I couldn't really see an end game and wasn't enjoying what I was making to the fullest
With the project I'm on now, I'm kinda doing it for me but will also release it
there's a healthy mix i guess... make a game that you enjoy to play
Yeah it's working great now! 😄
i'm basically doing what i would want to play, and learning a lot on the way
I'm trying to make an endless sandbox RPG, where if you die and have a child, you play as your child, and you basically see how long your legacy can go, whilst also managing a guild of heroes
Ah, so you just have a for loop that checks until the rotation is done and keeps going from there? That could work. My next choice was going to be to try implementing it on the actor itself and somehow call it from the ST graph, so maybe I'll go with that if I can't make a for-loop work.
currently i'm working with textures and how to do cool things with them
custom nodes, material functions
really cool stuff
That's awesome man, I'd love to stay updated with what you create
this is all i have except the itch
but i will post my projects and stuff when i get a website
i have one, i just have not uploaded stuff to it yet
got one for free i use for a server in a multiplayer game
this is pretty cool game
it's a board game like system multiplayer, and the popup messages are pretty cool
all blueprint
Nice man, well I've followed the discord channel so I will stay up to date
That is cool
unreal makes it easy to make a simple game look fairly decent
and i have a tendancy to ruin it with horrible level design lol but i'm getting better at it
Loool
having issues where the widget for life count updates properly however it doesnt remove the previous text, so it overlaps 5 with 4
so this overwriting ?
what happens when you get 6,7
do they keep overlapping ?
not sure, for some reason picking up a life doesnt change anything
this is begin play so it only runs once ? or your destroying and re spawning ?
yes because you are doing it on begin play
i wasnt sure where else to put it
the guide i followed for respawning used the begin play
don't plug all three into the same thing, make another sequence node and run it after, because now that thing runs three times
I figured I'd only need to create the widget once and if I had the textblock as variable itd be editable during runtime
yes it is, but if you only update it on begin play it won't change untill you respawn
and even then it will reset the variable its local to the player which it looks like it is
but when you die
what code runs ?
because i imagine it runs the event again
so i'm trying to make my game so when it's launched it runs kind of a open loading screen which purly is a loading screen no levels loaded at all and then when I want to load the menu level. I've tried doing this with standalone game but it's loading the level I'm in rather then doing the flow I would expect a new launch of the game to do
oh ok i see you pass it in
see this event here ? you want to run this when your life count updates
added that to my life pickup and that works
it doesnt overlap
it only overlaps on death
let me mess with TP char
okay so I added it to the event destroyed when life count changes
that did work temporarily
however when I respawned it did the overlap
Generally speaking you can't really not be in a level. The way that most games do this is that they'll have a primary main menu level and this is mostly empty. Your flow happens in a few different ways based on platforms. But it's largely pushing the right widgets to screen in the correct order. Like a Press Start on consoles, or doing the initial shader compile widget, or an initial accessibility settings picker, all before the main menu widget is pushed. Anything that is like 3D graphics behind these widgets are just streamed levels with their own camera sequencers mostly.
so I saw the 5 go to 4 for aboute 1 second and then when I respawned the 5 came back and overlapped the 4
same when I went down to 3
probably because your using the local variable and not the game mode one
So from what I've been told i cant be in a level as that'll stop PSO preaching in a way so somehow I have to hold off entering any levels including main menu levels until so precaching is done unless I'm misunderstanding what I watched from epic
wdym came back and overlapped ? @glossy crag
when the number changes it doesn't fully change it just overlaps ?
maybe you are creating too many widgets
yes when you die, you are creating another widget
create the widget in the HUD
and use that reference
this here is your problem
your creating a new widget every time you spawn
thats why it's overlapping
different widgets
so add a do once?
kk
or even player controller
but i use HUD for widgets
then get the that reference instead of the local one
if i do it in the gamemode I have a feeling itll appear in my main menu
which I have as a level to put 3d stuff in
is that like a seperate thing? or just a widget BP
so strange thing is even if I have a empty map be the default load map, the loading screen widget thing doesn't seem to show or at least it doesn't appear to show
if I make it a widget BP wont it still just re-activate upon respawn
the hud is a class in your gamemode override
that you can use begin play on and create widgets set references
Are you sure you don't mean bundled PSOs? Precaching is not the same thing. Bundled PSOs are compiled early on. And you do it in the main menu usually.
so bundled is the older version 5.3 and earlier
PSO precaching is the method they did for 5.4 and later versions
Precaching has been around since 5.1. Bundled has been around since UE4. But close enough. And they can work together.
https://www.youtube.com/watch?v=i35yf-wh3Bs - Arr i see so in this video I misread it they say in 5.3 and later its on by default precaching
Recently, there have been a number of conversations taking place in the Epic community around shader stuttering and its impact on game developer projects.
This week, we’re going to dive into why the phenomenon occurs, explain how PSO precaching can help solve the issue, and explore some development best practices that will help you minimize s...
5.3 may be when it became "production ready". But it's been in since 5.1
most likley
I believe Fortnite is entirely precache, I don't think they use bundled stuff.
well at the moment I'm trying to leverage the ability where the precache can be done on intial load
#multiplayer might know more about it
trying to find this and cant
Bump😁
bottom right
you need to create the HUD class first
ohhh gotcha
and then assign it in here, game mode override
how am I supposed to get the life count variable in here though?
you don't
you could, but you don't
keep the life and everything the same
just use the widget reference from the hud
but the life count display needs it as an input
just made a variable out of it and set the default
i overrode with the HUD and they dont appear but Im sure I need to connect the exec pins on these to something
i havent made any custom game modes though so I am unsure as to what node
your putting all the wrong stuff on there
only the widgets creations need to be in the hud
the rest you keep in the code you had
gotcha one moment
create the two widgets, add them to viewport, then in the original code
replace the create and adds, with the reference from the hud
where BP_MyHud is whatever hud you created and set in hyour override
then you pull from the as bp my hud, and get your reference
then use this in the original code instead of create reference
not
create new blueprint
literally search for "HUD"
create that as the new class
and then set it in the override
OH
alright give me a sec and ill start linking everything
I didn't realize it had its own class
yes it has it's own class, and then you can switch out your huds for different levels
this way it doesn't show up in your main menu level as long as you have a different override
I probably messed something up, it just shows Text Block now
new questiiooooonnnn when my widget constructs itself - the texts and such that are pure casts throw an error. just once, mind you as then it finds what it's looking for but performance wise what am i overlooking?
it wouldnt let me do Get from the hud
oh yikes i jumped in during something way more important
ya the white is execution
you got no power
I tried doing it from BeginPlay but that gave a bad reference error
as far as did you set the hud in the override ?
can you show the code ?
yeah I did
just stuck it at after the Set respawn transform and Im p sure it crashed UE5 lol
wdym something like bad cast ?
one sec i need to reopen it since it crashed
I thought maybe putting it after the player is spawned it might work
the greatest minds made electricity from doing nothing right
im jk
it should let me restore my session
cancel that engage - ive been cleaning up my code after a meltdown and uh.. forgot to change a delay.
you have some seriously odd logic here, you set a variable toitself and set something to null, and try to use that as a target ?
like i mentioned, all you had to do was replace the widge references
god damnit it just rolled me back
I tried replacing them but it wouldnt let me access them in the TP char event graph
it would only let me set them from the cast
your code was odd tbh, it did a couple weird things i think you need to look into the basics of blueprints
watch some tuts
this is all i have after restarting
i left the lifedisplay thing just to have it there
so make it look like it did in the original image you sent
that was working but overlapping
basically see how you used the ref
the variable said ref
you pulled from the creates
just replace that
idk how to simplify this anymore then that tbh
my thing is i don't mind helping, but you need to have an understanding of how things are working or i can't do anything to help
or i'd be wasting my time literally telling you every single little detail to do
I plan to go super in depth into blueprint details but I'm just in the middle of a summer class for my university and we have less than 2-3 weeks to make a functional game
so I've been kind of limited for the time being until its over
ill try to find some stuff online
ya i hear ya, its tough when your on a time crunch
kind of got to set prioritys
but a little understanding of how blueprints work would make things a lot easier
i can tell you how to fix it, but it's to you to actually do it
you just need to "replace the reference"
" replacing a reference means changing what an asset or object is pointing to" -google ai
you want to create the widget, promote to variable in your hud
so that you have this variable as your reference you can get anywhere
right
I did that but I cant access it anywhere else
when I drag out from the cast to hud it doesnt let me
show what your saying
then you didn't promote to variable ? show the code
If you must do things like that at least just have the HUD know when a new pawn is around and handle setting stuff up
there's zero reason why the pawn needs to be talking to LifeCount directly
easiest way to determin what side of a dice is up?
dot product most likely
i played around a bit with that but could not figure out how it worked, any tips?
just that it gives you a range from -1 to 1, and this shows if you are on which side compared to the angle
this is what I ended up doing, but i get errors of the hud ref being null
I just dragged as hud c lass out and promoted to var
but you deleted the set
it creates a set
get the hudref variable from the left
drag it out in front of the cast
and choose set
and plug as hud class into it
when you promote to variable you need to set the variable thats why it creates that node for you
i tried that too but it also didnt work
it does work though if you do it right
so what is the error for this code ?
Setting the value from external source is really really bad practice
It should be the other way around
Widget should be the one getting the life count
they probably just followed a tut i think they said that
yeahhhh
A lot of tutorial should get deleted
I couldnt find any good ones on the specific thing I needed
also I cannot find the issue with this set text block
it shouldnt be having issues
is this your widget ?
yeah this is all my widget has
its what it had when it was working earlier too
i replugged in the right references
You need to makesure the widget is already created before using it
This maybe a race condition
thats what the HUD class should be doing
I only have the two widget creations and add to viewport there
"race condition" means it could be loaded before or after
W.e it is you need to ensure that the widget is already created before use
on begin play where you get the reference
delay to next tick
if that fixes it then thats the problem
Where is this?
no straight from begin play first thing
its in my TP character bp
delay the whole thing untill next tick
can you show your override and your hud ?
well theres a problem
You never even set it
I think I have been misunderstanding the tutorials I was watching for certain things lol
they commonly drag and promote to variable and make their ref that way and it would just work for some reason
well they probably didn't delete the set node
because when you promote to variable it creates the node you need
if you delete that it doesn't work
it just makes the variable, but you have a variable with no value
ahhh I see
it works now but has some errors for the pickups and death, likely just need to rewire some stuff now
thank yall for the help
ill lyk if i run into anything weird
the face who's Dot(Face.Normal, World.Up) is highest is the one that's up
a perfectly up face will have that dot be 1.0, and one on the side will be 0, and the down one will be -1
everything works now but the only weird thing is I get these errors
theres no issues with decrementing or incrementing
it just triggers this if I die whatsoever
even if I dont touch any banana life pickups
why are you getting other actor's instigator
just check if other actor is the character
just what the tutorial had me do
that tutorial is shit then
tutorials can be helpful but blindly using them is a common mistake
What you have right now is asking "Is other actors instigator a BP_ThirdPersonCharacter1?"
When what you want is to ask "Is the other actor a BP_ThirdPersonCharacter1"
even people go a long time and a long way in a video game just following tutorials
That might be a race condition
without really understanding things
you might be destroying something then trying to modify it after the destroy call
How do I link this back to the correct name? im kinda stuck on this
im not sure why tbh
the life pickup shouldnt destroy unless touched
it doesnt cause any functional issues but i dont like the error appearing
have a socket or a scene component that faces each one of the directions. Or get the die's Forward, Right, and Up directions and their opposites
i got arrows on each side
get each arrow's Forward direction and dot that vs 0,0,1
i get the same error even with other actor instead of instigator
assuming arrows point on their own X which I think they do
see which arrow has the highest z
I started out like this
yeah this can work too
can someone pleasee explain what i have to do to make the grid placement lines on the ground?
If you wanna break out the z component then don't even dot
i made the whole placement system i only dont know how to make the white lines
just check which has the highest z component
if you have arrows the z approach is the easiest
wait why should it be X?
er nvm Forward is the x vector
they all point straight in a direction right ?
you want forward's Z component (which IS the dot product vs Z)
I fixed it
wanna hear how
I moved the actor
I had one like
right in front of player start, and it was disappearing before I respawned
but didnt count as a pickup
Race condition
overlap probably happened before begin play or something to that effect
Whichever Arrow.Forward.Z is biggest is the uppest one
what does it look like when it lands ?
that's the same number as the dot product
cant tell but up z should be a simple approach
do you guys recommend Stephen Ulibarri's courses for actual understanding of BPs?
Probably more than whatever tutorial you were watching
I already have the courses since I got them cheap a while back but haven't started since my game class takes priority
I will probably shift more towards the C++ side since thats what I know I just was on a time limit and blueprints seem more streamlined
it was hard to come by tutorials for specific mechanics I wanted which surprises me considering UEs popularity
I mean once you know the general structure and architecture of the engine, most mechanics are fairly obvious
Or at least the quick and dirty way to do them is
The most important thing is wrapping your head around the engine's structure and then BP/C++ is just a tradeoff of ease and speed to write vs capabilities and performance
just need to learn the foundation and everything else will be so much easier
It's pretty much the exact same API, most BP nodes are directly calling a C++ function
I figured, most have told me the C++ side is mostly for customizing said functions
where you are locked to whatever the engine has for BPs
That and doing the heavy lifting
C++ is about 100x faster, now whether or not that matters completely depends on the work you're doing
thankfully the game im making for my class is inspired by low poly stuff so i have luckily had little issue with running it
only con is the size of UE5, my assets altogether are roughly 30 mb while the entire game which is barely even a demo is almost 450
is that totally stripped and cooked or the project folder size?
Unreal is never gonna be tiny
unsure tbh, I built the project in Shipping mode and that was the size of the zip
You could make it smaller through some ways but whether or not that's worth it totally depends
im not sure if its bloat or not tbh
what you see in this vid is legit all I have in terms of like
content
I tried a plugin to cleanup unused things and it dropped maybe 70 mb
Its somewhat working now, but is it possible to get the name of the arrow component or is it lost in the array?
all the assets are handmade by me so none of the blender stuff is more than a few mb at most cause im a total noob at blender
idrk why its size is so big
Just put them in the array by order and return the number based on that is what I'd do
Result = Index + 1
You got gameplay, an art style, and UI, that's a lot further than many projects get
I'm really happy with what I have with the short time I had but I just cant fathom how it is nearly half a gig
thank you ^^ This worked well and I ended up with something a lot less complicated than what i could find online
You could maby strip out a bunch of unused plugins but idk how worth it it'd be
are there default ones that UE forces? I only have a project cleaner installed but it only targets unused assets
Hey everyone just looking for ideas about how you would go about a few things and best practices:
How would you Seperate Local and Multiplayer character controllers? Instanced from a main or some other way?
How would you Apply Power ups/Pick ups? My current thought is through the game mode and applying / spawning on server side on top of characters and have the server do all the heavy lifting.
I can't remember what the thing was called to draw and pull a config type data set of things to apply to characters EG Move speed, jump height, color, buffs, death fx etc...
Yeah there can be a lot of plugins on by default. You might try this stuff:
I’m not sure if there is a more up to date page like this
Wdym by multiplayer controller?
Server have a copy of everyone controller.
While client only know their one and only controller.
You can check if a controller is local by using isLocallyController node.
I would use GAS to apply buffs amd power up.
For multiplayer related question there is a channel dedicated for it #multiplayer
any chance anyone has any ideas?
What if instead of a projectile its just a pawn that can be possessed by the controller and u can fly it that way but the camera is still fixed to the original position, also what are you making is this a fly-by-wire tow missle thing?
Sounds like spline would work. WHat's the problem?
So i'm trying to make a foam particle to appear on surfaces using line trace, and i think i got it working, but there's 1 issue, the particle is overlapping the surface mesh which is causing Z-fighting, is there a way to slightly increase the height of the particle to fix this? the line trace is basically just getting the character location and tracing straight down.
Not the BP_Controller, I mean like Local Player and online player blueprints and inputs. Local as in same computer inputs not local network
Thank you for the GAS thing, I didn't know this existed
Ok i fixed it, i went to the particle asset itself and set the origin location's Z offset to be 0.1
I am not following, wdym by online player blueprints?
As for the input its normally handled in the controller / component attached to controller.
Was I not meant to have my inputs on the actual playerBP?
You can handle it in many ways depending on your game
Hmm, so I would need to pass my inputs to the posessed character BP from the Player controller. and that controller would be spawned as local(not Online) and also work for Online if need be
You dont spawn controller, each player are given one.
And client will only know their own controller.
Local controller just mean the control is local to the machine so maybe theres confusion on that part?
There is no "online controller"
You could also subtract from z in your bp location set on particle
If there are 3 players.
Server will have pc1, pc2, pc3
While each client only have their own pc
I think I am wording things wrong. I understand that part that you are explaining
#multiplayer pinned material is gold mine.
yes, tho setting location at world coords seems to conflict with a projectile movement component. it would be nice to blend the two or have another way of doing that
i should explain it like this, i want the player to "record" a gesture, then have some action happen based off that. so to start, i'd like an actor to follow that line, while still shooting forward like you shot a projectile. i don't want it to be like jett's ability in valorant, where the projectile moves towards where the camera is pointed. rather i want it to be:
- gesture recorded
- set projectile path to that gesture
- shoot forward while arcing along whatever path was set
- clear path&gesture
But that isn't the question I am asking. My question is do I use an instanced version of my online playerBP which has all my player phsyics and skeleton etc on it. or do I duplicate it and make another one or is there a better way
the projectile moved along a 2d plane when using splines
thanks, trying to make a new genre/mechanic here 😁
That sounds like expected behavior, doesn't it? Do you want the spline to be 3D?
I think all Genre and mechanics have been done
Oh the projectile? Sounds like you just need to have the actor's location and rotation be independent.
Do you have video?
so its like somebody holding a smoke grenade and waving it around on a windy day with their back to the wind
the path that is created is what you want the projectile to follow?
but the smoke is invisible so there is no visible trail
yeah, i'm 99% sure. a 3d spline would be ideal, tho i'm not sure how i'd manipulate the speed (aka movement over the z axis)
Define "Forward" in your steps, above.
So maybe something like press a button, it starts to capture mouse movement and does a line trace with forward vector for each snapshot and then each of those line trace end points is used as the next forward vector for the projectile actor to follow?
Don't use controller for when you mean character movement or something to that effect
a controller is a very specific thing in Unreal and it has nothing to do with that
isn't rotation which way it's facing?
Yes. So who's facing do you want it to be facing? The player's facing? Forward along the spline?
Draw it in paint.
Draw the mouse path, and what you expect the projectile path to be
i think so. like if the player moves the mouse up and to the right in a curve, the projectile curves slightly up. one sec lemme draw it
It sounds like you are already successfully generating a spline?
What I'm guessing you'll want is some homing towards a point along the spline, importantly, make sure you move that point at projectile velocity
Why not just spawn a dummy projectile and record it's movement and then actually spawn the projectile that replicates that
It sounds like he doesn't want super strict path following
lol
Like that? Where it tries to follow but doesn't instantly change direction right off the bat
i want it to always shoot in the general direction the player is facing
Yes so do what I said
@dapper thunder Do you have the creation of the spline already solved?
make a homing mechanic, ProjectileMovementComponent has that built in
nope, had issues with it
then home towards a position along the spline that moves at the same speed the projectile does
get the spline working first though
you can move a point down the spline with the get point at distance
yup
and just increase the distance at a certain speed
Horse has been lead to water and had face pushed into it
The homing is easy, cooking up the spline will be hard
get comfy with coordinate transforms
i mean trace, make spline point at position
assuming there's a cursor yeah
assuming there's a cursor just get hit result under it per frame, add your desired z height, and that's a spline point
Best way to start is to figure out how to turn mouse gesture into data. I'd recommend starting with an array of 2D vectors, loading one per tick.
weird cursor mechanics are tough
This was a bastard but it's easy once you know how
i don't want it to necessarily "home" though, just apply a speed over the z axis
unless that's what you mean?
what
z is up
it sure is
you want to curve your bullets up and down?
depends on who you ask
y is global right, what direction do you want the projectile to move in that it otherwise wouldn't have
it sounds like you want homing
in the XY plane
homing towars the path the user drew
exactly, which the mouse captures input on a 2d plane, so that last third dimension i'd want to apply a constant speed to
also not sure yet if i want the path to be exact or not yet
i mean you want your constant speed to be 0 vertically probably
Reminds me of a thing I made for a client (Diablo)
so yes do what I said, get the points, project them to the z height you want, and voila, that's your spline
yeah a bit like that but no cursor, the camera rotates so your mouse is really driving yaw and distance sorta
took a lot of work to make it feel good but it feels great, a constant snap of the mouse is a constant angle change, I could hit 90 degree snap shots ez
basically if mouse isn't moving, aim never changes relative to pawn position
only difference is i don't want it to go where the camera/mouse is currently pointed, i want that to be a one time recording that's used then thrown out
so you can record a list of points and then generate the spline based on that
yes vertically and horizontally just map to the mouse input, then distance is where the projectile's speed is set. awful wording 😅
draw debug those points
they're all very small
ok so i see you rotate and scale and offset, good
er you don't rotate, you just scale and offset. This will break if you're not facing global forward
hi, im migrating 5.4 to 5.6 and im having trouble identifying what's wrong with a blueprint interface that's unable to load in 5.6
so far i know it's related to stricter memory loading requirements but even completely removing everything from this interface won't get it to load
notes:
- big project, the actors with interface is already placed into levels, but it is not referenced by other blueprints, a lot of other blueprints that probably don't meet the 'no circular dependancies' requirement of 5.6 async loading as i understand it)
- the crash happens when empty level is loaded (so no actors actively placed in level) and the blueprint is edited (try to open it)
how can i tackle something like this? so far the only idea has been massive refactors of all the blueprints or it's some sort of bug and hope a 5.6 patch fixes it
why is this issue coming up?
i think its because it aint instance editable but it wont let me change it
@north bobcat you are trying to access property of a ptr that is not set
For a start show the code.
Hello!
I have been having a problem in UE5.5 where removing items from an data structure array is not quite working properly. (specifically the RemoveIndex node is what's causing problems, I think)
It seems to be removing, then reorganizing/scrambling the remaining values?
Specifically, instead of drawing 8 unique cards, I am drawing "duplicates", even though the cards are being removed from the array ((still 8 cards total))
This is for pulling from the top card in a deck (currently 8 cards in the deck) in a CCG - does anyone have any ideas? 🙂 If there's a better way to do it, I'm all ears as well
@frosty heron it is set thats the problem
Accesses none means you are trying to access null object at the time you are calling the function.
Can you show more of the code? This doesn't paint enough picture.
You are doing some checks that i cant see on the first page which may bypass the create widget and set function.
Also you need to make sure that the reference is set BEFORE you use it
thats the first thing i checked haha
So i assumed this is multiplayer then?
And you are running an instance where its not the listen server.
I made a basic sprinting system but idk how to make it for multiplay I made the stamina values copy to each player and each player has individual stamina but my other clients cant sprint for some reason
Not possible in blueprint at least for an authority movement.
You need to dive into cpp land and add your sprinting state in the prediction struct.
https://discord.gg/uQjhcJSsRG
In this video I am introducing a series I will be making which explores the character movement component and how you can extend it in depth.
0:00 Intro
1:00 What is the CMC?
2:00 Do you need a custom CMC?
5:35 What does the CMC provide?
7:10 Outro
thank you
ye it is
If you just play as listen server do you still get the error?
If you dont then you need to make sure that client runs w.e function that create the widget
Widgets r local though, its strange that you would initiate any form of widget in game instance (assuming you are using game instance there)
Initialise your hud in the player hud instead
no its gone there
its only when im on a client
??
Did you create the widget in your game instance?
There's like 0 reason to do it there.
all the code i sent you was in there
Thats a persistent object
Well that's not all the code, I dont even know whats calling the function and where.
There's not enough info to spot the bug.
https://youtu.be/q8Ih5EvStoc?list=PLzykqv-wgIQXompUswD5iHllUHxGY7w0q&t=2025 idk it worked for this dude
Blueprint multiplayer tutorial is full of trash content tbh.
I see 80% of the tutorial is teaching the wrong thing
80% is already being diplomatic
I will ask again is the widget created in game instance?
yea
Ye theres no reason to do it there.
its just the set text
When do you want the hud to pop up?
the hud is fine
As soon as the world is loaded?
o
And level bp cant communicate with other blueprint classes
Don't use that crap, unless you know the limitation
the dude said to do this tho
Many people that upload blueprint multiplayer tutorial doesn't know what they r doing
Not being on high horse you can ask in #multiplayer
its just a small issue that wont go away lol
wym inside the player hud?
i cant open it from inside itself lol what
Take a look at the common framework. You need to understand the life time of the object and what the common classes do.
Player hud, game state, player controller, player state
If you want to create widget at the time the world load, you can just do that in your player hud class.
Each player will have their own player hud class
PlayerHud -> begin play -> create widget -> show widget
Done
this is all i got lol even i dont understand what half of it is for
Then its time to read the pinned material in #multiplayer
Because knowing every single of those object is very crucial
You need to know whats replicated and not.
For example game mode only exist on server. A client attempting to get the game mode will get null.
right
Server has everyone controller but client only have their own controller.
Again another very crucial concept to understand or bug awaits.
Anyway for your hud i will just create a custom player hud, add it to your game mode.
Then just create at begin play of the hud
wait cant i just do it on event begin play in the menu character bp
That should create a hud for every single player.
this is it right?
oh no wait it is its own class
You can but can be dangerous as well if not understood.
Most common error is people create widget on begin play of the character.
Yet every time a character is spawned begin play is called
So often people end up with 3 duplicate widgets when there are 3 characters in the map.
2nd reason is that its not character job to display widget.
You would shove that responsibility to the class responsible for your common widget.
The hud class.
YourCustomPlayerHud-> begin play-> create main menu widget
i made one and it just copied my player widget that i alr have lol
dawg you confused the shit outta me lmaooo i dont know whats goin on fr
Multiplayer takes a while to soak in. I read the pinned material 2 dozens times and a lot of practice before it clicks in.
And after that its more agony.
Replication is like the easy bit, if your game is fast pace it gets a loootttt harder.
all i wanted was to solve this tiny issue lol
Nothing complicated from what i suggest though
Create widget on your custom hud begin play
And display it. Thats it
but why did it make a copy of my player hud
Character is not the right place to show main menu widget for the reason ive stated above.
Im not following
im not either bro 😭
you said make a custom player hud and it just copied my player ui
Each player are instantiated a player hud class. Im not talking about the widget
Create new blueprint, derived it from a player hud.
okay now im actually not following lol
Then you want to use that player hud in your game mode.
What is the HUD Class in Unreal Engine 4.
Source Files: https://github.com/MWadstein/UnrealEngineProjects/tree/WTF-Examples
Note: You will need to be logged into your Epic approved GitHub account to access these examples files.
you mean make one of these?
Shared a video above
Hello, I have a small problem 🙁
I created a new collision channel called “Player” and when I use it on the Player pawn and launch the game, the player slides to the side...
When I use the “Pawn” collision channel, I no longer have this problem.
When I manually add the Player pawn in the level editor, the pawn does not have the problem. It only happens when going through PlayerStart.
Can you please help me 🙂
I have a character not controlled by player that I want it to walk towards a direction
how do I simulate the IA_move?
Do you want them to only move when the player moves or something?
You can freely call AddMovementInput and just give it a direction
It is hard to tell without seeing your Pawn collision settings, but when you add new collision channels I believe their responses for existing channels default to Ignore. Your Player Collision channel is specifically being told to Block all the other channels. I don't know what channel the offending item is in, but if it is in something like Interactable maybe your Pawn channel is set to ignore that.
Hiya, is there a way to check if an input is pressed during gameplay ability? I want to have different behaviors for dashing based on whether a directional input is still pressed or not during the ability
Single player?
Yes
If it is you can just get the input value from the cmc
LastMovementInput or something like that, I cant remember on top of my heas
Ability casted -> get the caster character movement comp -> get input-> play montage based on direction
Is it expected that having ~ 200 active projectiles in the world tanks performance?
As a solution I tried implementing a simple custom projectile manager, which just has a projectile struct map and updates the location of projectiles based on velocity every tick.
But spawning 200 projectiles still drops FPS from 75 to 55 and blueprint time goes from 0.6 ms to 5.6 ms.
This is only updating the location with simple math, no collision checking, no effects.
Would it help moving this part to C++?
"Would it help moving this part to C++", imo when it comes to performance, the answer is always yes
but i could be wrong, this is just my opinion
as far as spawning the projectiles, don't spawn/destroy them
this is can be very heavy on performance
try instead to use a pooling
https://www.youtube.com/watch?v=XYPYfs-EMiw Maybe this helps
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...
yea, I know about pooling, but in my current solution I wouldn't even have projectile actors, it is all just "virtual" in the projectile manager.
I could then just add a niagara effect and also update its location to simulate a moving projectile.
But already this tanks performance, even without spawning any actors.
By "spawning 200 projectiles", I meant adding them to the map, not spawning real actors.
so just this simple math on tick with 200 items in ActiveProjectiles tanks performance
For a start, make some of your nodes non pure. Specially that Find call that is being called about four times for each projectile. Also consider moving this into a function where you can populate the array index into a local property because grabbing that costs a few nodes.
But C++ would certainly speed this up a ton.
Just tried that, moving everything to a function, only running find once, etc. It improves it a bit, but not much.
Guess I'll look into C++, haven't used it before.
Yeah. :/ Scripting languages are nice, but noticeably slow and clunky. For a start I wouldn't do this with a map. Arrays will be better I think. And you should preallocate memory for what you expect your average upper limit to be. It's fine if it grows over this but usual cases should be covered. Then you can do RemoveSwaps to avoid having everything shift when you remove one entry. And you avoid a lot of the costly per node overhead. Plus if you write it well enough this can all be done on worker threads so that it's not just one big loop.
TLDR you get a ton of extra power with C++ here since you're working with basic data.
the performance boost is defiantely noticeable
i would just make a blueprint function library in c++, this is the easiest way to get started
and then just offload the code to the c++ function
blueprint is horrible with loops specifically
That's part of it. But it's also memory allocation and access plus copying here. He doesn't have the tools to avoid excess allocations. Like if his map grows too much and then the whole map needs moved to a larger ram spot, that costs. Everything he's working with here is a copy of a copy of a copy of a copy. Lot of data writes that could be avoided with direct access. Plus all of the blueprint node function call overhead. Math nodes in BP are terrible for this cause you need so many of them to do such simple things.
There are the screenshots, and by default Player canal is set to BLOCK.
out of interest if I load into a new map where the game mode is different to the one in the map I was just in does the stuff like player controller etc all get destroyed and recreated in the class specified within the game mode ??
Is there someone who know how to repliacate the Nier Automata run?
When the main character run, and you change the orientation of the character turning aound. The character Relative Rotation (Pitch) is slighly increase to make the charcater curve. Any idea how you calculate that part of the rotation?
Unless I am mistaken your screen shot shows Player. I was referring to Pawn. They behave differently so they should have different settings.
pretty much everything gets rebuilt when you load a new level
except for game instance
awsome yeah only reason I asked is cause if I set game mode to game and UI on map a and then load into map b both have different game modes and different player controllers but look inputs will be a bit off unless I set game mode only before loading map b
hmm, is this specific to map b ? or it does the same when you load a from b ?
help
so it seems some how the game mode setting carries over from map a to b even though I wouldn't have thought it would not if the two player controllers and game modes are different on the two maps
Name it something else
it's not reccommended
hmm
"OutHit" ? x)
something like Hit0, hit1
hitt??
whatever works
but you'll eventually want declarative variables
atleast imean that they state what they are
Like HitFromSpecificTrace
so you can easily see the difference
i see
the ground have same behavior for Player and Pawn
Block for both
And i think the problem is not the ground because the player moved in air (before hit ground)
i check all components of the player and all are ok..
so whats the point of the custom channel you made ?
but in the vid that person dint get the msg
so you don't have to check every time to see if it's the right player and call a collision event only for player and the all pawns
youve got a worldstatic object that blocks all including player
andon the player it blocks worldstatic
so you just want your pawns to only collide with the player ?
@lofty rapids
no really
i just want a custom channel to diffentiate every pawn and Player
i mean im a bit confused about this
and i have a good behavior for all collision tests but
the player hit something and move of start position
they didn't get the message i see
This is because the input mode doesn't belong to these things. The PlayerController simply communicates with lower level systems that also persist. So even though the controller is killed off, the settings last set will remain if nothing else sets them.
arr thats makes sense then
what do you mean "differentiate from" ?
when ? and for what reason ?
is there a way to find where is that local variable
ya look on the left side
you should see variables, and local variables
you can also hit ctrl+F
and search "Hit"
yes variables you won't see local variables unless your in a function
but that wouldn't matter, it wouldn't conflict outside of the function
oni that problem im having
the rest wen im typing Hit it works
i typed Hit so many times
you shouldn't have a problem with this name
it's not literally Hit
the problem is something is already named Hit
exactly "Hit"
and by local it doesn't have to be local variables
just in that blueprint
then how is there a conflict then??
i want a custom channel to simplify c++ code
i don't want recheck on collision event Pawn == Player (i'm sure is the player because the collision presets allow only player to fire overlap event)
show the actual variables
not local
you must have a HIt in there
because the regular variables are also available in the function
i would watch a tut on variables
but i can't see all the variables
because you have them closed
but theres a hit in there somewhere