non MP-safe WML

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Vanagandr
Posts: 36
Joined: May 17th, 2014, 5:48 pm

Re: non MP-safe WML

Post by Vanagandr »

Ah, thanks. Does that mean that his code should already be mp safe (in 1.11 onwards)?
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: non MP-safe WML

Post by gfgtdf »

Vanagandr wrote:Ah, thanks. Does that mean that his code should already be mp safe (in 1.11 onwards)?
hm which code do you mean ?
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Vanagandr
Posts: 36
Joined: May 17th, 2014, 5:48 pm

Re: non MP-safe WML

Post by Vanagandr »

myav's wml code earlier in this thread. He wanted to know how to make his code not throw OOS errors. I guess this wiki page may also be relevant for him.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: non MP-safe WML

Post by gfgtdf »

hm mavs code earlier should alredy be safe in 1.10
the code you posted is most likely safe since 1.11.13

But i cannot tell for 100% because dont know for sure how the code worked before 1.11
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: non MP-safe WML

Post by Anonymissimus »

AFAIK, as long as you're using one of the events listed as "syncronized" you do not need to manually request synchronization with wesnoth.sync_choice. This is based on my experience coding the dialogs in SoW, where I have both lua dialogs and wml dialogs ([message] dialogs with options such as your example above, just called from lua). I only ever needed the manual synchronization for the pure lua dialogs.
So, message with options was safe already when the lua interface didn't exist yet. (How should a pure wml author use sync_choide anyway, that code above looks ugly).
There had been a bug wregarding side_for but it has been fixed. (side_for is incompatible with [option], in 1.10 or 1.12 at least).
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
myav
Posts: 85
Joined: August 23rd, 2008, 12:53 pm

Re: non MP-safe WML

Post by myav »

gfgtdf wrote: And expecialy in 1.10 i woudn't recomment to use [message][option] together with synconize_choice
gfgtdf wrote:hm mavs code earlier should alredy be safe in 1.10
And what to do then? ... If synconize not needed with WML choice, where can be OOS then?
Only safe events, safe rand, safe messages with options... Where then OOS ?

How many sense to test code on 1.15 when all people play on 10.7 ? I not get any errors in the 1.15 but always got in 10.7.

Realy, anybody can't help with my code and to find this very bad place with OOS? Wesnoth have 80+ members with status - developer, and I already wait for help one year...

My end coming? ... My work was too big and such sad "OOS" end to all 4 my maps.
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: non MP-safe WML

Post by iceiceice »

myav:

You have some misunderstandings here.

1) We the developers *do not* maintain UMC content. We maintain the wesnoth program, and the WML / lua API. It is up to *you* to maintain your code. If you were waiting for a year for someone to read your entire program and fix it for you, I'm very sorry that no one has told you in all this time, but that is simply not going to happen.

If you want help, look at what others do in the WML workshop -- post small code samples that do things that you don't understand, and devs can explain why the wesnoth program behaves as it does / whether it is intended.

It is your responsibility and no one else's to make that part happen. Getting upset and criticizing others won't help anything.

2) It is not possible to list all the situations that can cause OOS. That would be like asking Bjarne Soustroup "Please list all the situations where division by zero error can occur in C++." The answer is... if you divide by zero?

OOS is a runtime error. It can be caused potentially by *any* command or action which modifies the game state, depending particularly on *when* it is invoked. Moreover WML is not a formally specified language, so for that reason alone it is also impossible to give a comprehensive answer.

To cope with OOS, you can

a) step through the program very slowly one step at a time on both clients. Watch carefully to be sure that everything looks as it should!
b) use the gamestate inspector (:inspect command) to observe if variables are different.
c) use the replay viewer to get additional info
d) read and think carefully about the oos message itself. What exactly happened? Was the gold wrong? Was a unit not where it should be? The game will tell you exactly what is wrong if you will listen!

If you are unwilling to make an effort to do these things yourself you certainly should not expect anyone else to read thousands of lines of code that you wrote to fix the bugs for you.

3) If you have questions about whether something is synced / unsynced, you can poke around on the wiki, and you can ask questions on the forums, but finally the best way to figure it out is do experiments yourself. Make a simple test scenario. Boot up two copies of wesnoth and log onto the server, and run them and see what happens. The wesnoth engine has many quirky aspects, but one thing that you can rely on is that it is single threaded and deterministic if you fix the random seed. Generally speaking OOS is a testable and repeatable bug.

If you get a result from such an experiment that conflicts with what is written on the wiki, that will be regarded as a bug and there are many things to do at that point.

But this kind of whining is very much unwelcome:
myav wrote: Only this kind of errors completely ruins this game and shows low level of programming.

Wesnoth is already 7+ years old... and possibility of unknown OOS still not removed from game.

People, pls stop to ingore this kind of errors and please:

Make full list in the wiki (where will be listen all situations that may generate OOS error)

or

Please make stable game code where possibility of OOS will be completely removed.
The game code is stable -- plenty of people have successfully made many interesting mp scenarios and campaigns that don't generate OOS. Maybe you should download their add-ons and look at their code.

Removing the possibility of OOS from the game, without causing intolerable lag from network latency, would be a monumental effort requiring a rewrite of most of the engine. I doubt it could realistically happen in less than a few years.
myav
Posts: 85
Joined: August 23rd, 2008, 12:53 pm

Re: non MP-safe WML

Post by myav »

iceiceice wrote:myav:

You have some misunderstandings here.

1) We the developers *do not* maintain UMC content. We maintain the wesnoth program, and the WML / lua API. It is up to *you* to maintain your code. If you were waiting for a year for someone to read your entire program and fix it for you, I'm very sorry that no one has told you in all this time, but that is simply not going to happen.
I thinking that misunderstandings is not from my side...

Why? I will try to explain. WML-creators (such as me) not use in the scenarios any programming code (no C++, no java, and no any other language).

We use here only game commands (named WML and lua), created by "developers" of Wesnoth. All these commands [event], [set_variable] , [message] and e.t.c. are created by you and your team, and not by me. And if some of them are still bugged and still not listed any warning about possibility of errors when we using them in the wiki. And it is my fault?

So...

When developer:

a). create non stable game command which causes different errors
b). he not notice in the wiki for other people that this command is not stable (I not say anything now about noticed commands)
c). and as result - people receive unknown game errors (because in the wiki no word that they are not stable)

It is not our kind of problems, but your's. These kinds of errors must be searched and fixed by developers, and not by people which only use game commands as WML or lua.

And I wait 1 year not that people come and teach me how to write on WML ))) I wait this year, that developers start fix their own MP-errors and mistakes in the WML (because wesnoth still have a lot of them), and if error can't be fixed or removed - please notice in the wiki that this command is not stable.

It is very boring when: you using only "stable" commands (as written in the wiki) and receive non stable result (because we are being misled and command is not stable in the fact).

When created by "developers" game code (WML and lua) will be without errors and all unstable elements will be noticed in the wiki... WML creators will be happy and will be no problem in me or other people.
iceiceice wrote: if you divide by zero?
We all are not stupid people and not doing stupid actions similar to divide by zero.

I not use ANY command which is noticed in the wiki or in the forum, that this command can initiate various problems or errors.
So stop to write nonsenses similar to "divide by zero", because I always create code carefully and do not ignore any of the warnings from the wiki. And all OOS errors are not my fault.
iceiceice wrote: To cope with OOS, you can

a) step through the program very slowly one step at a time on both clients. Watch carefully to be sure that everything looks as it should!
b) use the gamestate inspector (:inspect command) to observe if variables are different.
c) use the replay viewer to get additional info
d) read and think carefully about the oos message itself. What exactly happened? Was the gold wrong? Was a unit not where it should be? The game will tell you exactly what is wrong if you will listen!
I repeat, I'm not silly WML-creator and before to write here, was used all this.

a). Game was launched a lot of times by me in 2 clients
b). Was used :inspeact more than thousand times
c). Was asked many players to help me and they help me, and says all what they doing during game and which number of gold they have after each action.

And nothing helped. OOS very well hidden. I have written here, only when I understood (after full weeks of searching) that the error is very deep, and only those who created these unstable WML, can be able to find deep error inside their creation.
iceiceice wrote: The game code is stable -- plenty of people have successfully made many interesting mp scenarios and campaigns that don't generate OOS. Maybe you should download their add-ons and look at their code.
I check new updates and new features, created by other people in the addons server - too often =))
And I very good know code of all best and most popular scenarios, because I always like to see new ideas. And many of them was inspected by me enough closely (how they did realize some interesting things)

And after all this... I can answer on your last phrase with 100% certainty: It is not true. Game code is unstable and they not got OOS errors only because: they not use heavy eanchanted scripts, created in the WML.


P.S.: and after all answers from your side, I only see that developers are not against to repeat many times about usual OOS errors and situations (about which they know) and very lazy to find new OOS inside their own creation, which are good masked and hard to find.

iceice you saw last version of any from my scenarios? I'm not usual WML-creator. I suggest for you to play in any of my creation and too see how many interesting surprises some people can add to gameplay. And after this, I hope that maybe you will have a desire to help people like me to find a OOS that we did not leave our work.
User avatar
Turuk
Sithslayer
Posts: 5283
Joined: February 28th, 2007, 8:58 pm
Contact:

Re: non MP-safe WML

Post by Turuk »

So let's do a quick summary here.

You lead off with telling the developers they are ruining the game with their low level of programming and tell them what they need to do:
myav wrote: Only this kind of errors completely ruins this game and shows low level of programming.

Wesnoth is already 7+ years old... and possibility of unknown OOS still not removed from game.

People, pls stop to ingore this kind of errors and please:

Make full list in the wiki (where will be listen all situations that may generate OOS error)


When multiple people respond to try to help explain, this is your first sentence in response:
myav wrote:So.. I start to become mad :annoyed: .


You proceeded to note that no one had still done the work for you:
myav wrote:Realy, anybody can't help with my code and to find this very bad place with OOS? Wesnoth have 80+ members with status - developer, and I already wait for help one year...



And yet, the developers were still attempting to figure out ways for you to troubleshoot the issue, but you responded with the following snide comments and demanding tone:
myav wrote:...created by "developers" of Wesnoth…

It is not our kind of problems, but your's. These kinds of errors must be searched and fixed by developers, and not by people which only use game commands as WML or lua.

…that developers start fix their own MP-errors and mistakes in the WML (because wesnoth still have a lot of them)...

... I only see that developers are not against to repeat many times about usual OOS errors and situations (about which they know) and very lazy to find new OOS inside their own creation, which are good masked and hard to find...

The developers on this project are volunteers who spends countless hours working on the game, and don't need to be insulted.

I gave you some leeway for your initial frustration over your OOS issue, but you are now well past Posting Guideline 1B. You need to adjust your attitude or you will be given some time to cool off.
Mainline Maintainer: AOI, DM, NR, TB and THoT.
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time
Vanagandr
Posts: 36
Joined: May 17th, 2014, 5:48 pm

Re: non MP-safe WML

Post by Vanagandr »

By the way, what is your add-on called? I might have missed it somewhere, but I searched on the 1.10 add-on server for author "myav" and nothing showed up.
myav
Posts: 85
Joined: August 23rd, 2008, 12:53 pm

Re: non MP-safe WML

Post by myav »

Turuk wrote:The developers on this project are volunteers who spends countless hours working on the game, and don't need to be insulted.
You write this only because you not know "how many countless hours: was wasted by me on all this ;) .

Not 1 day, and not 1 night.

Okey.. I will write about this, first time for 6 years.

When I have finished my first scenario (Green Island, 10k+ lines of code, without repeats) - I lost 1 full month of my life.
Then, I was away some time.. And after this I have returned back and have added a lot of upgrades and again more than 1 month of my life.

No sleeping in the night, only wesnoth WML was behind me ^_^ . it is funny, but it is not joke. Was very big enthusiasm.

After this I have returned again and again, and totaly, for 5 years I spends 6 full months (300 full days) on WML coding in the Wesnoth.

It is gigantic time. No one other game where I help with code not take such big part of my life.

And how many time was wasted on battles against OOS ((( Whole weeks of struggle and nerves..

And I becomes mad after all this... That after such big work, developers are lazy to find own errors in the game code.

If OOS error will be fixed in the game WML, it will dissaper in my code too. This is an obvious thing.

Vanagandr, my addons was: Green Island, Game of Kings, Deadly Competition but I remove them after OOS. Because all they are for MP-playing and no sense to play on them while OOS not removed from wesnoth.
Last edited by myav on June 18th, 2014, 11:31 am, edited 1 time in total.
User avatar
Turuk
Sithslayer
Posts: 5283
Joined: February 28th, 2007, 8:58 pm
Contact:

Re: non MP-safe WML

Post by Turuk »

No, I wrote it because no matter how much work you have done, it does not grant you the right to be rude or call the developers lazy.

This is not open to discussion. You can drop the attitude or take a week off.
Mainline Maintainer: AOI, DM, NR, TB and THoT.
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time
myav
Posts: 85
Joined: August 23rd, 2008, 12:53 pm

Re: non MP-safe WML

Post by myav »

Turuk, when I have asked first time, and second, and third (some years ago). I have asked plaintively and very well.

But now I see that not all.. but most of them are realy too lazy, so why we must to hide this truth ? What I must to write here after answers similar to: sorry, but I'm not helping to any people anymore.

And now not rude from my side. Only despair.
User avatar
Turuk
Sithslayer
Posts: 5283
Joined: February 28th, 2007, 8:58 pm
Contact:

Re: non MP-safe WML

Post by Turuk »

I interrupt this thread to inform you that myav will be taking a brief hiatus. Any further responses to his OOS questions will be addressed upon his return.
Mainline Maintainer: AOI, DM, NR, TB and THoT.
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time
Vanagandr
Posts: 36
Joined: May 17th, 2014, 5:48 pm

Re: non MP-safe WML

Post by Vanagandr »

Vanagandr, my addons was: Green Island, Game of Kings, Deadly Competition but I remove them after OOS. Because all they are for MP-playing and no sense to play on them while OOS not removed from wesnoth.
Well, if they aren't online anymore noone can really help you testing or look over the code.
Also you said somewhere above that they were working fine in 1.11.15 if I remember right? It shouldn't be too long before 1.12 comes out of beta, so if you just wait for that everything will be fine.
Post Reply