Тёмный

Scale from 0 to 1 (Object Pooling) in UE4 

Pending Kill
Подписаться 3,2 тыс.
Просмотров 2,5 тыс.
50% 1

Scaling objects down to zero is a common industry technique for "spawning" or "despawning" objects without actually having to instantiate or destroy them. Rather, they simply stay where they are, hidden from view and disabled from physics or collision, until you need them again. You can use these to switch from controlling the main player character to controlling a vehicle (or a morph ball), creating destructible blocks in your level, and switching weapons. We use Unreal Engine 4 for the examples shown.
Support future videos on our Patreon: / pendingkill
00:00 Morph Ball
02:09 Destructible Blocks
02:44 Weapon Switching/Pickups
03:48 Industry Example (Yooka-Laylee)
Come say hi!
Twitch: / pending_kill
Facebook: / pendingkill
Twitter: / pending_kill
Instagram: / pending_kill
TikTok: / pendingkill

Опубликовано:

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 15   
@1_Man_Media
@1_Man_Media 3 года назад
Cool video but honestly if you are not going to interp that 0-1 over time just shift from 1-0 you might as well just make use of actor hidden in game or visibility. With your step on the block for example you have a minor hitch cause you bounced off the object basically, you could easily of set that to just go hidden in game collision response = none and play that particle this way you would fall right through without the hitching. Add a small lerp time to that 0-1 so things grow in your hands or whatever and it would make more sense to use 0-1. Either way cool video I enjoyed it and subbed keep um coming I love watching how other people do stuff.
@PendingKill
@PendingKill 3 года назад
You are absolutely correct in your assertions and yes changing collision responses or rendering can also be used. The reason we made this video is that we noticed that many devs' kneejerk reaction to anything is to instantiate it and destroy it and many times it comes with issues (such as pending kill bugs). In the video, we did interp for the morph ball and blocks and that minor collision was intended. For the blocks, it was an just a standalone example, but in the levels we're building, we usually have a row of them and based on your speed you are meant to walk over them fast (like in the case of the speed booster) or fall. Thank you for your comment! We appreciate this level of engagement and we have a couple more topics in mind I'm sure you'll love :)
@1_Man_Media
@1_Man_Media 3 года назад
@@PendingKill I agree I have definitely seen some bad use of destroy when not necessary leading to errors with actor pending kill, and I really liked your Samus style guy - ball / ball - guy transform. I didn't hear any mention of an vinterp or timeline lerp, but it makes sense it was present cause that transition looked good. I very much look forward to more content, and wish you guys the best with your development in the future.
@maxmustsleep
@maxmustsleep 3 года назад
like Ryan said before me i'd be interested how this compares to hiding and disabling or changing collision of actors. thanks for the quick and informative video though!
@PendingKill
@PendingKill 3 года назад
All of those things work and they each have their own uses and by all means you can combine them! From a design perspective, instantiating and destroying over and over again leads to more headaches than scaling. From a visual appeal perspective, I found that this scaling method is much better than popping the visibility when handling items.
@musicdudem6673
@musicdudem6673 3 года назад
And thank you, this is that top shelf content the world needs!
@musicdudem6673
@musicdudem6673 3 года назад
so say if you have a program where a character has say 30-50 weapons and items to equip and choose, does that mean youd want them all equipped at the same time on the player to switch between different options? Or would you be able to put a parent blueprint of the items that could swap out between all of the options available to save resources?
@1_Man_Media
@1_Man_Media 3 года назад
It would come down to the type of system you are using. Having 30-50 scale 0 items on your char would work, but might not make the most sense with that large an amount of weapons. You could also have just 1 weapon and change its mesh based on what weapon your using (provided you can also ik the hands for each), and of course you can spawn / destroy weapons and attach them to sockets as needed, but like poster said this can lead to pending kill errors. However if your code is clean and your references are solid this method works as well. In one of my previous releases which was a shooter. I had 2 mesh 1 for each primary and secondary and switched the mesh based on the weapon you slotted to each hand.
@musicdudem6673
@musicdudem6673 3 года назад
@@1_Man_Media thank you! That is helpful
@germanslice
@germanslice 3 года назад
I ran into a similar obstacles with doing my game Tesseract Prime Offworlds but i like the idea of shrinking down the mesh instead of deleting it and then having to respawn it in again, is this instancing and removing is what causing the slow memory leaking in Unreal Engine?.. . Because Unreal Engine does have an issue with slow memory leaking when you leave the engine running on by itself for a period of time, things tend to slow down by themselves in it after a while and that's by not doing anything at all in the engine and just leaving it in idle mode for for a few hours or a day or so. So I'm not sure why the engine slows down after a while when you leave it in idle mode.....And the refresh rates begin to slowly change the longer you leave it running...I think there's an issue here with the pie editor. FINDING THE MESHES: The biggest challenge I have is finding all the resources for all the different characters on the different worlds and the one thing I notice is a lack of buildings that are all hollow, for most of the building meshes seem to be just solid meshes that you walk all around, but in my game I need to be able to go inside some of buildings interiors as well, not just walk only around just the exteriors. If I use a building modular system, then I could bog down the engine with too many meshes pieces just to build the city or buildings..... And also Mixamo Animations have got a problem with targeting other skeletons in Unreal Engine. It dosen't like Unreal Engine. PROCEDURAL SPLINES I'm reluctant to resort to Splines to try to procedural generate the buildings in the world because splines are known to mess with the construction script. GODOT COULDN'T EVEN CHANGE MY SKELETONS. I was thinking of putting my game inside of this engine but I could not change the skeleton of the demo mesh that was in it I couldn't replace their mesh with my commander's skeleton. They don't have change mesh option yet as Unreal Engine has.. So to change the mesh I think you would have to redo the code that mesh is using. DIALOG SYSTEM WORKS BUT I've been using Validated Get to turn the widgets on and off in the game with remove from parent. Which seems to work. I got the basic dialog up and running in Unreal Engine with the help of others in the community But I have to find a way to track the different planets and systems also in the game (keep track of the different worlds that you visit) You also need an Ai Master Controller System to control all the other AI Controllers that are in the map so that we don't have them all running all at once. Layley is busy doing a video on that to show us how to manage all the AI in the map.. DIALOG CHOICES WIDGET WHERE DO WE START ON SETTING THIS UP? Not sure how to handle dialog branching choice menu up to go with the dialog text system. GLOBAL MANAGER NEEDED FOR STORYLINE PROGRESSIONS AND QUESTS TRACKINGS ON EACH WORLD. I need to know how I can store all dialog storyline progressions flags that change dialog branching to trigger off certain events in or events in the game. I have already written out all the dialog branching of storylines in notepad for most of the different worlds. Like Kotor did with choices and consequences flags in the menu dialogs. Except they used a dialog tlk node editor to construct their dialog and turn on or off certain flags with the dialog editor to trigger certain storyline events in the game while I just used simple Notepad and a whole bunch of Array nestings in batch code to try to construct all my dialog branches which also worked.... That way I saved myself thousands of hours of constantly firing up the engine all the time just to edit changes to dialog when i can make all the changes outside of the engine and then just cut and paste the dialog into the data table, er yeah. .. So far I have been stringing storyline events as booleans switches and storing them up in the Game Mode BP. Gets Complex when it involves activating storyline and quests flags on different worlds... And that includes also dealing with Different Councils Issues you run into also on those different worlds and Diplomacy and Trade issues among the different Factions and Conflicts on different worlds with Council Treaties also Vendors who either sell you good or bad stuff. A global manager also for tracking the different planets you've been to or systems you unlock. Keep track also of the items you pick up in each planet. So my game is a little complex.. So I'm not sure how you keep track of everything going on all the different worlds yet. Does anyone know how to make a global management system for all this stuff I need to keep track of? When it comes to dialog storyline progression. I know how to do the storyline progressions with just one world but with tracking of many different worlds storyline events? That I only how to do that in batch code, not in unreal engine yet... The game also has a level progression system, inventory system. but I don't know if the inventory system or its level progression system is set up for global progression across all maps yet or just only works for the currently loaded level in the engine.. I guess i have to load in another level to find that out. So I just chucked the item flags changes and storyline triggers into the Game Mode BP for now. But I might have the wrong BP to store the global flags in. I think Game Mode just stores up in memory what's in the currently loaded level... If that's the case then it will only track whats in the currently loaded level in memory. Still what is stored has to be saved into a save file. So it is only game mode for storing one level and the game instance for storing all the flags for all the other levels? I'm not sure how you set up these type of choice and consequence games in Unreal Engine. The game is not being built with World Composition, as I don't know how Unreal will handle switching between worlds to different party members if you give them missions to do on different worlds. Currently they do only do on one world at a time that the party visits. Either that or my game is a little too complex for the engine. But Kotor was able to do a complex game with alot of dialog, so it should be possible. The dialog part is not a probem, but all the flag branching progresssions of different events in the dialog is. Unreal engine should be fast enough to just switch instantly to different worlds but I think at the moment that Playstation 5 can only do that.. Unless you have to use world composition. I thought I would explain what some my challenges are with trying to set up my game in unreall engine in case someone has some solutions to these limits that I ran into. Including also the memory leak issue as well.
@choppedsirloin9215
@choppedsirloin9215 3 года назад
As a newbie who has just recently started learning UE4, this is very useful! It makes me curious though, just how many similar tricks do game developers utilize?
@PendingKill
@PendingKill 3 года назад
Lots...I certainly don't know even a fraction of what's been done before. But check out the Unreal Slackers discord channel, lots of good stuff posted there. And obviously YT tutorials. There's also a book series called Game Programming Gems, a bit dated but a lot of it is still relevant. For a sense of what insanely smart people have come up with in the past, check out medium.com/hard-mode/the-legendary-fast-inverse-square-root-e51fee3b49d9
@choppedsirloin9215
@choppedsirloin9215 3 года назад
@@PendingKill Thanks for the response! I'll definitely look out for more. Also, after having read that article, I now know that I know nothing. That is definitely some high-level math and computer engineering skill.
@PendingKill
@PendingKill 3 года назад
@@choppedsirloin9215 Feel the exact same way man. True wizardry...
@jaxsun2924
@jaxsun2924 3 года назад
can this be done thru blueprint? bcoz i hope you can make a tutorial for it. Although this is a good video, but i dunno how to create it lol
Далее
Rotating Objects in UE4, Benchmarked (Get better FPS!)
12:16
How to Create a Team for your Indie Game
14:14
Просмотров 4,8 тыс.
Math for Game Programmers: Building a Better Jump
25:43