Coder Social home page Coder Social logo

Comments (2)

brifsttar avatar brifsttar commented on July 19, 2024 1

Hi,

Thanks for you quick answer.

However, a point has been brought up a few times that making an Actor survive the transition between Levels is difficult

I don't think switching from Actor to Component would solve that issue. AFAIK, only the Game Instance (and associated subsystems) are persistent between levels, and those don't accept components (as they aren't actors).

But again, would probably break all existing projects and require them a lot of refactoring? I don't suppose there's a way to make it both Actor and ActorComponent without almost total code duplication?

That's why I suggested keeping the ATcpSocketConnection with its existing interface, but changing the implementation to instead rely on a component that actually has the features (with more or less the same interface). That way, all existing implementation using the actor should still work, but the TCP features would also be available as a component.

However, if we actually want to solve the lifetime issue, it would be a bit more complex than that; because as mentioned above, neither actor nor component can survive level transition. An idea could be to move the TCP features to a game instance (or engine) subsystem, and have both the TCP actor and component using the underlying TCP subsystem. That way, users could choose between actors (traditional), components (modular) or subsystem (persistent) to do their TCP communication.

But that would add way too much complexity to a plugin that shines by being simple and just working. So I think neither this nor the "proxy actor with TCP component" are great ideas. I'll go ahead with the component change on my fork, but I won't make a PR for it, as it'll bring changes that don't actually fix the most common user issue (lifetime).

Thanks again for your answer and your work.

from ue4tcpsocketplugin.

CodeSpartan avatar CodeSpartan commented on July 19, 2024

Hey,

I haven't worked with UE4 in many years, so I don't know if I had any reasons to make it an Actor. Probably for the simplicity of just throwing an Actor into the scene. I don't think the conceptual difference between an Actor and an ActorComponent or SceneComponent is significant enough on its own to introduce the change, because I don't want to introduce breaking changes to existing projects for very little benefit. It's already hard enough to keep projects up to date with UE versions without plugins breaking down on you.

However, a point has been brought up a few times that making an Actor survive the transition between Levels is difficult. I wonder if making it an ActorComponent and attaching it to an Actor that survives the transition, such as PlayerState, would make the connection survive as well? (I'm writing this purely speculatively, as I don't remember what actors survive a level transition, if any. It's been a long time.)
If ActorComponents have an easier time surviving level transitions, then it'd be something interesting. But again, would probably break all existing projects and require them a lot of refactoring? I don't suppose there's a way to make it both Actor and ActorComponent without almost total code duplication?

from ue4tcpsocketplugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.