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"

Trying to Completely Duplicate the Working Shootergame code for open IP Multiplayer games

Updated Source Code Download Ready on Drop Box!

With Complete Source Code Replacement to match ShooterGame code much better (CTRL + F1 to run the HostGame code from shootergame) !

alt text


Dear Friends at Epic,

After having successfully played Shootergame as true multiplayer game with Alexander, and now also Adric, using open IP

I adjusted a lot of my internal code to match the Shootergame code better :)

Now I have a new updated download available!

Nathan_Lyer\VictoryGameMultiplayerTest\VictoryGameTestFullyUpdated.rar

I also fixed my config files to match Shootergame more closely.


My prior mistake:

I was not calling the shooter game online code for HostMatch at all before, I was just using "open ?listen" to start an online game.

I also modified the gameinfo PreLogin rules to always pass back a empty string error message to ensure other player gets accepted


Now I am calling the shootergame HostGame code as closely as I can, minus the actual GameType string value.


Alexander, or any one else who wants to try this:

When you get the chance,

Please download my complete game .rar and see if you can get an open IP game going with anyone else :)

You can msg me here or pm me if you want to meet up at some specific time, and I will re-post my IP


To be the Host

After you start game, press CTRL + F1 to become a listen host and run the Shootergame HostGame code :)

If it doesnt work I am really not sure what else to do code-wise, because I'm carefully copied over all the shootergame code and and this time I'm actually running it :)


When you press CTRL + F1 this code runs:

 AVictoryGameGameInfo* VictoryGameInfo = Cast(GetWorld()->GetGameInfo());
     if (!VictoryGameInfo) return;
     
     FString TheGameType = "Fun";
     FString HappyURL = "/Game/Maps/Victory?listen";
         
     //Host
     VictoryGameInfo->HostGame(
     this, 
     TheGameType, 
     HappyURL
 );

copied from shooter game along with all the other code related to this:

 /** Starts the game */
 bool AVictoryGameGameInfo::HostGame(APlayerController * PCOwner, const FString & GameType, const FString & InTravelURL)
 {
     bool bResult = false;
 
     check(PCOwner != NULL);
     if (PCOwner)
     {
         AVictoryGameSession* Session = Cast(GameSession);
         if (Session)
         {
             ULocalPlayer * LP = Cast(PCOwner->Player);
             if (LP != NULL)
             {
                 TravelURL = InTravelURL;
                 Session->OnCreatePresenceSessionComplete().AddUObject(this, &AVictoryGameGameInfo::OnCreatePresenceSessionComplete);
                 if (Session->HostSession(LP->ControllerId, GameSessionName, GameType, false, true, 4))
                 {
                     // @todo Show loading movie
                     bResult = true;
                 }
             }
         }
     }
 
     return bResult;
 }

alt text

alt text

Product Version: Not Selected
Tags:
picforyou.jpg (235.7 kB)
yaay.jpg (190.1 kB)
more ▼

asked Mar 11 '14 at 02:15 AM in C++ Programming

avatar image

ue4-archive ♦♦ STAFF
50k 3667 1996 9121

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

2 answers: sort voted first

One Interesting Replication Issue I Cant Solve

alt text

When a projectile is initially spawned, it faces wrong direction, but on the next frame ( I know its one frame cause it was really hard to get this screen shot) the projectile corrects it orientation.

the odd thing, is that on the listen server (top left) the projectile shows up correctly. And this issue only occurs in multiplayer context. Single player is always correct.

so its some sort of initial replication issue, but I dont know how to fix it :)

When you get a chance to check out my game and can see this for yourself, please let me know what you think solution might be.

I spawn the projectile from Private/Character/VictoryDragonHumanCharacter.cpp Line 192

 AVictoryDragonHuman::ServerFireProjectile_Implementation

Projectile class is VictoryProjectile

 //SERVER
 void AVictoryDragonHuman::ServerFireProjectile_Implementation(
     FVector_NetQuantize10  Origin, 
     FVector_NetQuantizeNormal ShootDir)
 {
     //no current projectile class to spawn?
     if(!CurrentVictoryProjectileBP) return;
     //~~~~~~~~~~~~~~~~~~~~~~
     
     
     //Spawninfo
     FActorSpawnParameters SpawnInfo;
         
     //SpawnInfo.bNoCollisionFail = true;
     SpawnInfo.Owner = this;
     SpawnInfo.Instigator = this;
     //spawn creature
     AVictoryProjectile* Projectile = 
         GetWorld()->SpawnActor(
             CurrentVictoryProjectileBP, 
             Origin, 
             ShootDir.Rotation(),
             SpawnInfo 
         );
     
     if(Projectile) Projectile->InitVelocity(ShootDir);
 }

:)

more ▼

answered Mar 11 '14 at 02:15 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3667 1996 9121

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

Hi Nathan,

"Could I put my game on drop box for another Rocket user and have them try to open my IP"

Multiplayer should be possible by sharing your project, creating a listen server and having another user connect to your IP. We just tested this with shootergame in Beta4 and it is as simple as giving both players the same project, then hosting and connecting. If you would like, we could test your project and see what results we get.

"Is there a way to get the Onlinesubsystem / Steam to work pre-shipping build?"

A developer will be able to help with this in your other thread: https://rocket.unrealengine.com/questions/6140/steam-c-how-do-i-access-the-instance-of-the-online.html

If there is anything else that I can assist you with, please let me know.

Thanks,

Alexander

more ▼

answered Mar 11 '14 at 02:15 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3667 1996 9121

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

"If you would like, we could test your project and see what results we get."

wow that's an awesome offer thanks!

Let me do a little replication coding and then I will upload so you all can check it out

Knowing that you got it working will help me enormously to know I'm on the right track :)

thanks again!

(Will post again here when the download is ready on drop box)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

I got replication of shooting and sword swinging working!, as well as character switching :)

File is uploading Drop Box to:

NathanLyer/VictoryGameMultiplayerTest

It's about 647 mb, so it will take about 2 hours from now to upload

I put full keyboard and mouse control info in a txt file with the .rar :)


Art Content Legality: All art content in this project is either stuff I got from your awesome UE4 demos, or is of my own creation. The warrior character art and skeletal mesh are licensed to me through purchase.

Feel free to share my project with anyone, and any of the C++ code :)


One known issue: sometimes when switching characters (T key) character will freeze and if you keep trying to switch you will end up in a big purple and pink space, that expected at moment

But replication of sword swings and shooting animations and the actual projectiles should work (T key to switch from warrior to the spikey guy)

Ribbon trails on sword are not yet coded to replicate.

You can press V key to cycle among various weapons as Warrior, including the sword from the Effects download demo :)

But this doesn't replicate yet :)


Dedicated vs Listen Testing

Game is meant to be 2 player at present, and with one player as a listen server.

Dedicated server testing will load, but the 2nd character type will not be available

So listen server testing is ideal :)


If You Have Time

All my current efforts to utilize the OnlineSubsystem are evident in my code, if you press ctrl + T while in-game, a bunch of tests will run to see if an onlinesubsystem can be found. That code starts on line 2313 of the player controller class.

If you get the chance and can point me in right direction as to how to get onlinesubsystem working (I already copied over all the shootergame online code) that would be lovely.


My Main Interest

If you can host a listen server game (you can press CTRL + F1 to start a listen server game quickly)

and have someone join that game via IP or any method (as per Alexander's post)

and all the stuff listed above seems to be working

then

Yaaay! (see picture for details)

Rama

alt text

yaay.jpg (190.1 kB)
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

Dear Alexander and Friends at Epic,

Thank you again for checking out my game!

It's ready on on dropbox for download!

Nathan_Lyer\VictoryGameMultiplayerTest\VictoryGameMultiplayerTest.rar

See above post for all details :)

Again there's a .txt in the .rar with various controls info :)

Update: Entire Source Code Replacement and Crash Fix

I did some substantial coding most of the night to fix the character-switching crash/bug in multiplayer.

It should be resolved now and you can press the T key as many time as you like, as fast as you like, while moving into mountains or wherever :)

I also added a PRI class :)

 SourceCodeReplacement_DownloadMe_CrashFix_RobustCharSwitching.rar
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

Hey,

We got a chance to play around with this. The switching works fine and we really like the ribbon effects. We were having problems with either character replication or connection, because we could not see the other players character while in multiplayer. We were not able to see the error you describe in your other comment because of that. If you would like, make that into a new bug report post and we can have a specialist look into the issue.

Thank you,

Alexander

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

Hee hee glad you liked the ribbon effect!

What is interesting is I do not have any problems with character replication on my side,

I also have not modified basic character replication functionality at all, I'm simply extending from ACharacter as per the the third person starter kit.


in all my testing I've never not been able to see the other player's character.


Any idea what this might be causing this?

Perhaps it is a connection issue and is related to my post about the Steam.DLL not being found.

Link-> Log Error: SocketsSteam.DLL not found


I can't easily debug this on my end since the behavior never occurs :)

Debugging: Did you trying joining the game via 127.0.0.1 to see if you get any different results? That's all I've ever done on my end it and all characters are always visible :)


Thanks for the help and testing!

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

I could successfully test it on a local host and see both players, but when we tried to do a host/client with different machines, it did not work. I know your project is mainly based off of third person, but have you made any alteration to the network code?

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

Perhaps a critical change I made was actually in config/defaultengine.ini

I changed the shootergame version from this

 [OnlineSubsystem]
 DefaultPlatformService=Null
 ;DefaultPlatformService=Steam


to this

 [OnlineSubsystem]
 ;DefaultPlatformService=Null
 DefaultPlatformService=Steam



maybe try switching back to the shootergame config version which is this?

 [OnlineSubsystem]
 DefaultPlatformService=Null
 ;DefaultPlatformService=Steam



No I have not changed any network code,

so perhaps the config file settings have the answer

I dont think I changed anything else from the shootergame config file settings, but I may not have copied all the appropriate things


Thanks again for your awesome assistance!

:) :)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

By the way,

do you get the SocketsSteam.dll error message that I get when I use -log, when you run my game on your end?

alt text

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

I am not getting the RocketEditor-SocketSteam.dll error you are receiving. I am talking to a programmer about some potential causes for this multiplayer error. He wanted to know about any potential code changes you may have made. We are going to poke around in the config and see if that is the cause too. Once we have a better idea, we will try to find a fix.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

Ok we want you to try to do an online test match with the ShooterGame project to narrow down whether this is project specific. We can successfully run ShooterGame multiplayer games, so we know it will work. Can you please get shootergame and try to connect to a multiplayer match with another user?

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

I have re-unzipped shootergame, unmodified,

and I am hosting a match, but I dont have another rocket user to test with at moment :)

I can post my IP here if you like :)


by the way, regarding the steam error

I ALSO get the error when I use

 [OnlineSubsystem]
 DefaultPlatformService=Null
 ;DefaultPlatformService=Steam

but it looks a little different:

alt text

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

What is the IP, I will attempt to connect if you are hosting

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

my IP is

 76.6.55.138



Sorry I missed your msg earlier :)

I am perma hosting the game with no count down timer

:)

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

Unless I was playing against an especially good bot, it looks like we can connect. My programmer says that the issue would have to be somewhere in your project, but we are not sure where exactly. You may have to look into the shootergame files and compare them to see where the connection is not being made. As far as the load errors go, I'll have to get a specialist to look into those, so make sure they have their own topic. It was fun, I am sorry we couldn't find the difference in the two projects that is causing the error.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

hee hee yea that was fun :)


how did you change your name while in-game?


I have already created the steam-log-errors thread here: https://rocket.unrealengine.com/questions/6140/steam-c-how-do-i-access-the-instance-of-the-online.html


You joined my game by doing console command open IP right?


I dont know why any of the code / config file differences will matter if we know that steam module is never loading

When I do not use

[OnlineSubsystem] ;DefaultPlatformService=Null DefaultPlatformService=Steam

and use

[OnlineSubsystem] DefaultPlatformService=Null ;DefaultPlatformService=Steam

I still get lots of error messages, and worse ones actually, indicating that no onlinesubsystem could be loaded

:)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

To change your name, in command console "setname [name]" without brackets of course. I was able to join by simply doing the console command "open [Your IP]" This is a very strange issue, as everything you are saying indicates that it should be working, that is why I think you will need Josh's help. He is very good with in-depth issues.

At the very least, the test was very helpful for us understanding multiplayer from within our HQ to an outside IP. We will play again together, I am sure.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

please see my original post for update, I was not calling the shootergame HostGame code at all :)

was just using "open ?listen"

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

my character is by the little icon/statue/abstract art thing toward the center of the map

:)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

woohooo!

that was fun!

you're really good :)

those rockets need to be a little faster though I think :)

It's amazing

normally people have had trouble connecting to my computer via IP

you got through just fine!

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

By the way I stopped the count down timer in shootergame by pressing T key, so I am perma-hosting at moment

I've sent out some msgs to other users and will let you know if I get chance to try this with anyone :)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:15 AM

By the way here is an even better log picture

I am not succeeding in initializing Steam at allll :)

this is using defaultengine.ini

 [OnlineSubsystem]
 ;DefaultPlatformService=Null
 DefaultPlatformService=Steam

alt text

(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