x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Disable moving pawn with platform

Hi I would like to know if there is a way to avoid moving pawns that stand on a platform which is moved with SetXXXLocation() in code.

The platform is moved very far away - and the pawn standing on it will practically teleport to that new location.

Product Version: Not Selected
Tags:
more ▼

asked Mar 12 '15 at 02:24 AM in C++ Programming

avatar image

JerryTheRook
116 7 16 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I went a completely different way to solve this now, so this can be closed.

more ▼

answered Mar 22 '15 at 04:20 PM

avatar image

JerryTheRook
116 7 16 15

avatar image Burnrate Apr 21 '18 at 09:20 PM

Why would you post this and not say what you did?

avatar image JerryTheRook Apr 22 '18 at 12:10 AM

Maybe, because the solution was totally unrelated to the problem (that's why I wrote "I went a completely different way")? But yeah, that was 3 years ago. I'm still sure I'd have posted a solution if it had been related.

avatar image Burnrate Apr 22 '18 at 12:58 AM

It doesn't matter if the solution was a fix for your specific technical problem. You found a solution somehow, either a workaround or using a different mechanic to satisfy your gameplay design. It is a solution and it is related.

avatar image JerryTheRook Apr 22 '18 at 02:33 AM

No, I never found a solution for this, that's the point. I guess the word "solve" in my initial answer is throwing you off, English isn't my main language though, so I used that word in the wrong context I guess. I simply went for a quadtree based approach with automatic lod generation for the whole game world - is this answer more satisfactory? I guess not. I am not going to write a tutorial on how to generate procedural worlds with all the optimizations I came up with as an answer to a question that is, in my opinion, still unrelated.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I believe the "problem" is a feature where a Pawn can be "based on" another primitive component, and when that based on component moves the Pawn will move with it. A Pawn is usually "based on" whatever it is currently standing on. You can disable this for an actor by turning "Can Step Up On" to false, but your Pawn may bounce around when on the platform.

There isn't a way to manipulate what a Pawn is "based on" in Blueprint, but in code, the best way to handle this is to probably call a SetBase(NULL) right before your SetLocation calls.

If you want to do this in blueprint but still are using C++, you can create a BlueprintFunctionLibrary function that would call SetBase(NULL) on an ACharacter.

If you don't want to do this with any C++ at all, you might be able to achieve this buy applying an upward force on the character or really any force that would cause the character to no longer be "based on" or "standing on" the platform when the platform is moved.

more ▼

answered Mar 12 '15 at 02:54 AM

avatar image

Allar
3.1k 51 120 487

avatar image JerryTheRook Mar 12 '15 at 01:43 PM

Hey, thanks for the answer. My project is basically 99% code, so SetBase could work but would be really inefficient for the way I am doing things.

I am working on a theoretically infinite world which is constructed around the player in form of procedurally generated meshes. Since it is a Top-down game I am generating a fixed amount of chunks around the player - just enough to fill the screen.

When the character e.g. reaches the next chunk in forward direction, I take all the dynamic mesh components from behind him and place them at the front of the currently visible chunks and rebuild the meshes for just those components. This way a character can walk around infinitely.

The problem is - the server needs to have the visible chunks from all other players too (for networked collision physics), clients only care about their own chunks - it doesn't matter if other players, which aren't in range of the own chunks - and thus can't be seen, fall through the floor on the client side. If the server now moves the chunks around to rebuild them at other places, it will move the pawns that stood on those chunks with them - since the server has the authority over movement physics.

I didn't really think about the SetBase() method - so thanks for the suggestion, but my structs, which manage the chunk movement don't know which character is currently standing on which chunk. I could iterate over all the characters for each chunk to be moved and do all of that, but like I said it would be inefficient.

At first I experimented with just having the dynamic mesh not have any collision at all and just place a huge collision box at the floor of the map - since the idea was to only have totally flat tiles (but I am not really sure if I want them to stay flat anymore), but huge collision boxes have extreme precision issues - the larger the box gets, the more the characters stutter while walking over them (weird thing is, a huge BSP placed in the level didn't have those issues).

avatar image JerryTheRook Mar 12 '15 at 01:43 PM

I tried many different ways of just having a helper blueprint to build many smaller collision boxes and stuff, but it doesn't really support the theory of infinity, so I went the more landscape-like approach with the dynamic mesh collisions.

I am also not really sure how AI would work on such a dynamic world, how would they find their way through the level if I only have the necessary chunks loaded at any time? But I guess this is a completely different matter.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question