Renaming MyCharacter, Exposing a var from C++, other questions

I’m back storming with more questions :slight_smile:

  1. How can I rename MyCharacter after creating a 3rd person C++ Project? I tried cloning MyCharacter to EliumCharacter in the editor, and then renaming it at the only code reference I could find (line 11 at GameInfo.cpp). but whatever I do it keeps using the reference to MyCharacter, which if I try to delete, throws back at me a bunch of errors saying it’s in use by some Internal and External referencers, confirming it is indeed still using MyCharacter

  2. How can I expose a var from my C++ class into the editor? I’ve added what I believe is all the needed code:

    EliumCharacter.h - public block

     UPROPERTY(EditAnywhere, Category=Camera)
     FVector CameraOffset;
    

    and EliumCharacter.cpp - AEliumCharacter::AEliumCharacter(const class FPostConstructInitializeProperties& PCIP)

     CameraOffset = FVector(-120.0f, 0.0f, 30.0f);
    

    and still, I can’t get it to appear in my character’s blueprint in the editor.

    sorry if this might be obvious, but all info I’ve found is related to blueprints by themselves but not how they connect to C++ (and I’m not too versed in C++ myself)

  3. Has replication been made any easier, or does it follow the same scheme and flow as in UE3?

  4. Judging from what I saw in the ShooterGame it seems obvious the networking model is still server-client. Are there any plans for the future to alterate this model? It’s the reliance on rented servers that seems not too indie-friendly for me, as opposed to games that might have some very few servers for matchmaking and let then a P2P networking model. Or perhaps a hybrid model where a player is the server, but if he leaves the game migrates to another player instead of just ending. I’m just ranting here, but it’d be nice to know if you have any plans regarding this.

  5. How moddable-friendly will UE4 be? the replacement of .upks in favor of separate .uassets seems like a great move for source control and patching, but how will this affect moddability, and how moddable is UE4 meant to be overall?

thanks!
[edit: great I wanted a numbered list of questions, all of my numbers appeared as 1, or I get 1,2,1,2,3]

  1. When you say you cloned ‘MyCharacter’ it in the editor, did you duplicate the MyCharacter.h file? The GameInfo reference should be the only one, could you post the errors you were seeing? That file should automatically have been changed to match your project name when you created it. Is that not what you were seeing?

  2. That certainly looks like everything you should need. Are you sure that the Blueprint you are editing derives from your EliumCharacter class? The Blueprint parent should be shown on the toolbar.

  3. Replication is the same idea, but we have added features and improved the workflow. I’m going to ask someone else here who knows more than I to give details!

  4. I will let our network expert comment on this as well.

  5. Because of the change to C++ and DLLs, and a much more extensible editor, modders should have more power than ever. I don’t forsee .uasset files being a big problem - we anticipate most shipping games will combine those into .pak files, we already have support for that.

Replication is fundamentally the same. Replicated properties, rep notifies, RPCs (replicated events) are the building blocks for multiplayer game code. Most of this is available at the blueprint level now too.

Under the hood, there’s been a lot of improvements:

  • Support for multicast RPCs

  • Supper for TArray replication (dynamic arrays)

  • Custom NetSerialization for structs (structures can overload NetSerialize and serialize their payloads however they want)

  • Component replication (static components can replicate properties and events)

  • Actor bunches are now atomic and not limited in size (large actor bunches will be automatically broken up before sending, but are reassembled and handled atomically on the other end).

  • NetDormancy has been added as an optimization for games with high actor counts (actors that don’t frequently change can be put into a dormant state which lowers cpu burden on the server).

  • The PackageMap system has been revamped. It is now more light weight, flexible, and dynamic; backwards compatibility without conforming packages, and no more initial exchange of package lists with HAVE/USES.

  • bNoDelete has been removed which allows map-placed actors to actually be deleted on the server.

Work is ongoing to improve the network code, especially in areas of server optimizations, traffic management, and work flow issues (integrating network support into the editor and PIE to make developing multiplayer games easier).

Regarding servers: listen servers and player-run dedicated servers will always be supported. The challenge in supporting a peer to peer model would be in reworking game code to not rely on a central authority. I think this could be done but I think listen servers with host migration is a better option for most games. I’m not sure to what degree host migration will be supported in the engine, but it would be possible to add.

thanks for your answers! some great insight here.

one.

I didn’t duplicate MyCharacter.h because it simply doesn’t exist. by creating my new project from the 3rd person template with the name Elium I already had a class called EliumCharacter.h and a search on win explorer tells me there is no MyCharacter.h anywhere in my project folder. it was only named MyCharacter inside the editor.

errors I see when I try to delete the MyCharacter blueprint in the editor:

mychar.jpg

two.

yes my blueprint’s parent is EliumCharacter:

eblue.jpg

just the same, the one named MyCharacter in the editor also has EliumCharacter as its parent.

and yet I can’t get a var I’ve tried exposing to come up in there.

additionally, any changes I do in code (which do get reflected when I hit Compile in the editor) are lost when I close the editor and either launch it again, or launch my game directly using a cmd line argument. so I need to open up the editor again and hit Compile again to get my code changes again.
perhaps this has something to do?

three, four and five.

thanks for the info. at least component replication and replication of large actor bunches sound very interesting. and I guess at least UE3’s replication documentation will be useful here.

also pleased to hear you might at least consider adding host migration. every step taken towards not having to rely on paid servers is a win for indie developers with multiplayer in mind :slight_smile:

There are several things that you shouldn’t do using the ‘hot reload’ Compile button inside the editor:

  • Make modifications to constructors
  • Add new properties

Are you compiling in VS when you make these types of changes?

oh I thought compiling in VS and hitting Compile in the editor produced the same result! I’ve never been so wrong :slight_smile:

so now the changes I do ‘stick’ whenever I exit and re-open, and I can now expose vars to the editor.

thanks!