You must be logged in to post messages.
Please login or register

Scenario and Map Creation
Moderated by alincarpetman

Hop to:    
Welcome! You are not logged in. Please Login or Register.9 replies
Rise of Legends Heaven » Forums » Scenario and Map Creation » Script files in multiplayer: Bugged?
Bottom
Topic Subject:Script files in multiplayer: Bugged?
Agamemnus
Zekeling
posted 07-03-06 10:57 PM EDT (US)         
Today, I tested a scenario that has a script file in multiplayer. In general, the results were not encouraging.

Script does seem to work, but as soon as it is activated there is an out of sync error and the other player drops.

I also modified a scenario. (the one where you free the Sand Warden--Dakhla) I added in a player 2 to the game and started it. None of the script worked. I started as player 1 (Sawu??, some tribe or other?), and player 2 as intended with 2 heroes. I had to wait until I had 200 gold to buy a city. Eventually I got the tech to see in my territory, and I finally found blue. Then I disconnected from him seconds after...

The other scripts I used were as follows. They work as intended except for the whole OOS.

1)

Quote:


void game_callback on_game_frame() {
Location test1 = "test1";
run_once {
create_unit ("1","Glass Dragon Start", test1);
}
}

2)

Quote:


void game_callback on_game_frame() {
Location test1 = "test1";
run_once {
create_unit ("1","Glass Dragon Start", test1);
}

void game_callback on_unit_killed (Unit the_unit) {
Location the_location = unit_location(the_unit);
create_unit (get_unit_leader(the_unit), get_unit_type(the_unit), the_location);
}

I did play around with the "type" of game in the map editor, testing it as "multiplayer" instead of "scenario". Same results. At all times, it is a "1v1" game, countable in the score system...

So I guess this is a semi complaint/question: has *anyone* been able to get ANY script working, and if so, what is it? If not, BHG needs to fix it if they want their game to have any decent scenarios.

:-)

AuthorReplies:
DarthVeda
Hero
posted 07-06-06 08:09 PM EDT (US)     1 / 9       
Your second script does not compile. You're missing a closing brace after run_once.

Your example:


void game_callback on_game_frame() {
Location test1 = "test1";

run_once {
create_unit ("1","Glass Dragon Start", test1);
}

void game_callback on_unit_killed (Unit the_unit) {
Location the_location = unit_location(the_unit);
create_unit (get_unit_leader(the_unit), get_unit_type(the_unit), the_location);
}

Corrected:


void game_callback on_game_frame() {
Location test1 = "test1";

run_once {
create_unit ("1","Glass Dragon Start", test1);
}
}

void game_callback on_unit_killed (Unit the_unit) {
Location the_location = unit_location(the_unit);
create_unit (get_unit_leader(the_unit), get_unit_type(the_unit), the_location);
}

After fixing the coding error I tried out both examples on a blank test map, and I couldn't get the OOS you were talking about.

Most single player campaign scripts probably won't work in multiplayer. A number of the functions that work in single player aren't designed to work in multiplayer. Particularly some of the UI stuff and the main game loop that is called is also different (on_solo_frame in sp vs. on_game_frame in mp).

Not to mention that the single player maps aren't set up for multiplayer at all. (Player starts, etc.)

Agamemnus
Zekeling
posted 07-07-06 00:10 AM EDT (US)     2 / 9       
Well, the bracket was there but I didn't copy it correctly to the text here. Again, the code works excellent in single player.

If you did test this using two connections on the same computer, it would have worked.

Hipskovski and I did some testing and we figured out why it is not working.

The reason:

The script file is not transferring to the other guy!

We tried everything. We tried both the "/custom maps" and the "/maps" folder and everything in between... what did work was me sending him the ".bhs" file outside of the game system. This way, there were no problems...

So, the system does not seem to transfer scripts, and that doesn't seem right..

Evolved
Zekeling
posted 07-07-06 06:05 AM EDT (US)     3 / 9       
Not only that, I'm yet to hear of a Scenario being succesfully transferred across the net.

I've tried for half an hour, with the scenario being 1.4 MB I think and 2 Half Meg Connections. I've tried that 5 times.

MudokonGod
Banned
posted 07-07-06 07:46 AM EDT (US)     4 / 9       
I transferred a scenario across the game lobby.

Didn't have a script though.

Evolved
Zekeling
posted 07-07-06 07:49 AM EDT (US)     5 / 9       
Cool.

How long did it take?

Agamemnus
Zekeling
posted 07-07-06 11:39 AM EDT (US)     6 / 9       
The speed is pretty slow. It took about 15-30 seconds for a 62 KB file to be transferred to the other guy if he doesn't freeze. That's eyeballed data from my test with Hipskovski yesterday night.

At 62KB every 22.5 seconds, that's 2.755 KB/s. If you're talking 1.4 MB, that's 1433.6KB, so it will take 520 seconds or 8 minutes and about 40 seconds to transfer.

Usually though the other guy's connection and interface will freeze up (instead of the "Do you want to download" prompt) and it will take longer....

Oh yeah. One other thing I've noticed is that sometimes my scenario data will not activate, and I'm left with a black minimap/black map, and "empty" buttons, etc..

[This message has been edited by Agamemnus (edited 07-07-2006 @ 11:40 AM).]

Evolved
Zekeling
posted 07-07-06 11:49 AM EDT (US)     7 / 9       
The black minimap thing might happen if the scenario is set up wrong. Happens to me all the time on maps I make for 'scenery'.
Hipskovski
Zekeling
posted 07-07-06 01:43 PM EDT (US)     8 / 9       
That 62 KB file only took a second or two, All i had to do was click okey twice and it would finish right away. I guess it matters on the connection between the two people but between you and I we had at least 30kb a second going.
Agamemnus
Zekeling
posted 07-10-06 11:24 AM EDT (US)     9 / 9       
So..... BHG.... are you going to acknowledge this problem and fix it, or what?
You must be logged in to post messages.
Please login or register

Hop to:    

Rise of Legends Heaven | HeavenGames