Random Map Generator Out of sync with custom badges

Hello,
I’m using a random map generator with my mod. After one of the more recent patches, I was running into an out of sync problem in every multiplayer match for no apparent reason. After a process of elimination it was determined that the random map generator was the cause, and it only would cause an immediate out-of-sync if either of the players had to download a badge from the other. I think there were some issues with a “downloading content” bug when badges are transferred that was fixed in a recent patch, and it may be possible that the solution to that bug caused this one to crop up.
I know a random map generator is a corner case thing, but I’d really like to keep it as a feature even when players have custom badges. Thanks!

Seconded, we have randomly generated maps too

Thirded, also have randomly generated maps- though I’m not sure if this is an issue for me yet. Are you generating level assets during gameplay?

Level assets are generated during gameplay. It started happening ever since the downloading assets bar was seperated from the main loading bar, as far as we can tell.

Damn it’s sure to affect me then; are the assets spawned after the player is able to move forces? or before they can take any actions?

I entered a bug report in our tracking system to have someone look into this. We’ve been looking for a good case to repro the Out of Sync problem. :slight_smile:

It’s hard to imagine the badge change causing an issue with this. The ONLY thing that was done for that was that I added bin\badges as another search path for custom badges. It still searches in the bin\profiles\badges directory as well so none of the previous logic was changed.

I believe the content download fixes were in the first patch and were fixes to an issue where players would get stuck on the content download screen. The content download process is started before anything else after a game is started and it waits for all players to complete the download before moving on and loading everything else.

The out of sync tests do not test badges so even if the badge is not correct for all players it wouldn’t generate an out of sync.

I don’t know anything about the random map generator mod. Does it generate a map on one persons system then other players in the game download that map, or is it a deterministic system where the map is generated by each player? What/where is this random map mod?

The map is deterministic, generated by all players individually running the same code. It may have an issue to do with the random seed, i have no idea. I was able to replicate the OOS by running two instances of the game on my computer and joining on LAN- it would only occur with a player using a badge not contained in the .big.
The mod is Freespace Fleet Command for the remastered engine- its on steam but is not public yet. I can put it on dropbox when I get off work to help figure out what is going wrong.

Where did the random map generator stuff come from? Was this LUA script that existed from a previous HW2 Classic mod?

It was created by the Star Trek Continuum team and was used in their HW2 classic mod. I never ran into problems with it in classic and AFAIK they didn’t either.

In all honesty the current method the games uses is obsolete and outdated… One of your future priorities should be to get a global loading and downloading screen done. Rts games like the coh series have and & c&c tiberium wars too. Show the players how other players are loading or if they dropped during the loading process. And if they were dropped you should implement an AI take over so the game is not automatically, necessarily & immediately ruined once somebody drops.

As for the badge bug I can’t confirm this but that’s also only in 1 case thus far. So far I’ve played only 1 game a 1vs1 where the host did download by custom badge which was created by myself and located in:

Steam\SteamApps\common\Homeworld\HomeworldRM\Data\badges

There was something worrisome though. The amount of time it took was equivalent to a 3vs3, 4vs4 game. For a moment I thought he or me crashed. That should be getting looked into. I can’t imagine that downloading a few kilobytes take that long. Then again I can’t tell what the other guy did at that time perhaps he was browsing in desktop while the game was loading there’s no telling.

Anyway to get back to the topic there were no messages or other indications that our game went out of sync in that particular case.

My map collection has random maps in it. (Marked with a pair of dice in the level thumbnail.)

http://steamcommunity.com/sharedfiles/filedetails/?id=399477672

I haven’t tested whether they crash in multiplayer since I gave up trying to get a multiplayer match going due to all the desyncs, crashes and so forth in general.

Random maps would cause occasional issues in HW2 also IIRC.

I’ve actually had a super stable experience with random maps and a ton of custom scripts. The only issue I ran into with OOS in classic was with a large volume of sphereburst weapons at the same time against subsystems.

Was that our Random Map Generator then? Stargazer shared that? Hmm… definitely need this fixed then! :smiley:

Yes! It is an awesome piece of code. I modified a couple of the constants but otherwise it’s the same framework. Did you ever have OOS problems with it with HW2 classic?

Not once, although multiplayer was quite rare in the first place because of the horrible hit and miss nature of even being able to see the other guy’s game :confused:

I’m working on generated Maps too. In my tests maps that use the random() function most probably will cause an out of sync after loading.

My way around was using the old randomseed(Number) to force similar starting conditions for all players and it worked.
Sadly they are not really random in this case.

The Guy I’m playing with always uses custom badges and there was no problem.

Take a look if you are interested in my Code. (If you are not allowed to dl I can mail them)
http://www.filedropper.com/generatedmaps

The Rich and Normal Version for 6 and 8 players for 100km caused out of sync and crashes after a long playtime. Sadly it did not create any dumps or Logs. The 75km version runs fully stable, as far as I know.

Codewise there is no difference, so the oos should be related with the size of the Map or the number of asteroids.
Maybe big maps >75km(?) on different Machines create different roundoff errors that cause the oos. At least the models are effected.
http://cloud-4.steamusercontent.com/ugc/709654199018569451/8373C65FAF2E1C13B484C7A9A05AD661AFAF5F77/

Most multiplayer crashes I had seemed to be releated to an access violation. Someone on Steam forum said this might have to do with SteamOverlay because disabling it fixed the crashes for him.

I didn’t realize the randomseed function still worked.

[edit]

I thought it was disabled in the HW2 1.1 patch.

I thought the same.

It feels like it does not really work - but this might be because of the way my scripts work. So always similar or same random values are selected for my map - even if I changed the seed. Have to take a look at that again - i’m pretty sure it’s my script.

But what it definetly still does … it forces to start with the same random value. Simply tried it out one day and solved the OOS problem on loading.

If you look at the crate game rule in death match there is a specific random seed number used, I believe it might be an mp safe random seed since it doesn’t generate the same crate location or contents each game