[Solved] Very weird bug with Multiboards ; )

Status
Not open for further replies.
Hello !!!

Capture.JPG

Yes, this is a screenshot :p


Well; In my map, my goal is for the player to be able to check some different multiboards, but when doing the technic with the "GetLocalPlayer()" (which works; I tested it in Multi), some weird stuff happen:
EACH time a multiboard is displayed (it can be the same that you are seeing which is displayed again), the previous multiboard remains ! and it weirdly overlaps, overlaps and overlaps again as long as you display more and more.

My "sequence" of trigger is like this :

INIT: event after 1sec ; creates 12 multiboards with arraw variables (MULTIBOARD[1 to 12])

DISPLAYER: event player select a unit;

clear MULTIBOARD[#] (which obviously doesnt work)
change title
change number of column
change number of rows

Fill up the multiboard

Displays to the player(INTEGER is player number):
Capture2.JPG



MULTIBOARD UNSELECTED: if a player unselect one of the unit displaying the multiboards, it hides MULTIBOARD[PLAYER#] (with GetLocalPlayer too)


Can anybody tell me why the fuck is this happening ?? I saw no report of this bug...
http://www.hiveworkshop.com/pastebin/1d22090ee03ea8ffe55c74e511595cca6339/Here is the map if you wanna the check the triggers (under the folder : "Multiboards and UI") and try the map to understand the problem (click on the "heroes" or on one of your town to display a new multiboard).
Thanks for checking the forums !!



PS: how it looks when you click once (F1) (Government) :Sans titre.jpg
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
Strange, only 1 multiboard should be visible at a time. Showing a multiboard with one already visible should replace the currently visible one. Might be related to the custom UI frames or changes with the recent patch.

In any case a solution (I think) would be to hide all multiboards and then show only the appropriate multiboards for each player.
 
It has to do with a bug related to reducing the multiboard row and column count.
http://www.hiveworkshop.com/threads/weird-multiboard-bug.234897/

Instead of setting it to an exact number, you have to decrement it one by one. For example, if the mutliboard has 6 rows and you want to make it have 3 rows, you have to first set it to 5 rows, then 4 rows, then 3 rows. You can do this using a simple loop.
 
Level 13
Joined
Nov 7, 2014
Messages
571
the previous multiboard remains ! and it weirdly overlaps, overlaps and overlaps again as long as you display more and more.

I think this is caused by the MultiboardClear native, don't call it =).

Instead of trying to reuse multiboards by clearing them and then setting new row/column counts, multiboard item's texts, icons, etc. make different multiboards for the different use cases that you have:

1 for displaying unit information
1 for displaying town information
1 for displaying resource
etc.

Actually those need to be arrays because you aren't doing a single-player map but that doesn't matter.

When you need to show a unit information to a player grab his multiboard from the "Unit_Information_Boards[<player-number>]" and modify it to show that unit's information then show it to the player via GetLocalPlayer().

This way you can also avoid the bug that PurgeandFire has mentioned because you don't need to resize the multiboard anymore, each "type" of multiboard (unit information, town information, etc.) has a fixed number of rows and columns.
 
Strange, only 1 multiboard should be visible at a time. Showing a multiboard with one already visible should replace the currently visible one. Might be related to the custom UI frames or changes with the recent patch.
Well yes it's very weird ^^. It s even weirder when you know that the bug is MUI... and that bigger multiboard's content shrinks to fuck up even the smaller ones.
In any case a solution (I think) would be to hide all multiboards and then show only the appropriate multiboards for each player.
Well I guess that's what I'm doing. But what I can try is to destroy and recreate one each time, with hiding it and then show off the right multiboards again for the players that had one displayed (which means their multiboard[x] exists; otherwise it be destroyed anyway).


Instead of setting it to an exact number, you have to decrement it one by one. For example, if the mutliboard has 6 rows and you want to make it have 3 rows, you have to first set it to 5 rows, then 4 rows, then 3 rows. You can do this using a simple loop.
Hum... I'm not sure it comes from that cause when displayed several time in a row (no pun intended), with the very same multiboard construction (same width, style and even content!), it overlaps with the "new" data that are actually the same (you see the text getting brighter and brighter the more you display the same multiboard) Government.JPG ---> Government2.JPG --->Government3.JPG (well here, some of the content change but you get the idea)

I think this is caused by the
MultiboardClear
native, don't call it =).
Well, I tried removing it and just change column/row content; it doesnt work ^^

Instead of trying to reuse multiboards by clearing them and then setting new row/column counts, multiboard item's texts, icons, etc. make different multiboards for the different use cases that you have:

1 for displaying unit information
1 for displaying town information
1 for displaying resource
etc.
I guess that would be a good solution ! ... unless that when as said earlier, if I use one shape of multiboard, it also fucks up. I'll try it by initiating the multiboard with the right number of row/column for one of the displayers



Thanks a lot guys ! I'll try some stuff and tell you if it still fucks up ^^



EDITS :
-Clear Multiboard actually works ^^ (but doesn't help)
-It seems to be the column/row change which fucks everything up(even though they're used to set the same number of colums/rows)
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
-It seems to be the column/row change which fucks everything up(even though they're used to set the same number of colums/rows)
Which is similar to what people said earlier.
It has to do with a bug related to reducing the multiboard row and column count.
Might be a good idea to construct a cache of multiboards of the required sizes and reuse them as necessary. Otherwise if the size is dynamic you might need to destroy and create a new multiboard of the required size.

If using GUI be aware multiboard actions are extremely inefficient. The way the column/row fill is implemented results in them performing operations numbering the sum of multiboard row and column count. Although it seldom causes performance problems it can cause threads to hit the op limit and crash, especially when setting up multiple or large mulbiboards in a single thread.

Example showing the GUI implementation of set icon.
JASS:
function MultiboardSetItemIconBJ takes multiboard mb,integer col,integer row,string iconFileName returns nothing
  local integer curRow = 0
  local integer curCol = 0
  local integer numRows = MultiboardGetRowCount(mb)
  local integer numCols = MultiboardGetColumnCount(mb)
  local multiboarditem mbitem = null
  loop
  set curRow = curRow + 1
  exitwhen curRow > numRows
  if (row == 0 or row == curRow) then
  set curCol = 0
  loop
  set curCol = curCol + 1
  exitwhen curCol > numCols
  if (col == 0 or col == curCol) then
  set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
  call MultiboardSetItemIcon(mbitem, iconFileName)
  call MultiboardReleaseItem(mbitem)
  endif
  endloop
  endif
  endloop
endfunction
 
OK. I think I've got this. PurgeandFire seems to have found the bug. I thought it wasnt that but since I Cleared the multiboards, the number of columns/rows was reduced to 0 meaning that I actually increased their number by more than 1 even though it was the same number of row/column as previously.
I'm stupid ^^

If using GUI be aware multiboard actions are extremely inefficient. The way the column/row fill is implemented results in them performing operations numbering the sum of multiboard row and column count. Although it seldom causes performance problems it can cause threads to hit the op limit and crash, especially when setting up multiple or large mulbiboards in a single thread.

Example showing the GUI implementation of set icon.

Oh wow ^^
I encountered those problem which is why I had to "split" triggers into multiple ones to be able to process the whole thing. But it doesn't feel like the problem comes from here...


EDIT : I tried with changing the number of column one by one :
-With removing "CLEAR" : it works fine for the same multiboard displayed multiple times (no overlaping of the same text over itself, ofc, the triggers changing row/column werent used...) but it still fucks up when displaying other sizes

-With having CLEAR before (having to recreate all the columns/rows from 0 I guess) : it fucks up like before ^^


I'll do it as Aniki proposed it should work fine ; )

I created 5 multiboards (array) with the appropriate rows/column
Then I set Multiboard[x]=multiboard"stuff"[x] and can use my older triggers the same way : )
It works perfectly; but we still don't really know why is this bug occuring ... It doesn't seem to be fixed by changing the size one by one so it may be an other bug related to the GUI trigger?
The sad part is that I cannot change the size dynamically and would be needing to create tons of multiboards at the beggining

Thanks to you all guys !
 
Last edited:
Multiboards are really weird. Having a set of predefined multiboards of fixed size is definitely the best solution here. Memory is cheap, so don't worry about the performance of that.


I can't imagine the pain the makers of Dark Invasion II must have had. That game literally consists only of multiboards.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
I can't imagine the pain the makers of Dark Invasion II must have had. That game literally consists only of multiboards.
Genesis of Empires 2 is another good example of a map which pretty much is only multiboards.

One might be able to hide columns by setting their width to 0. This may be useful in that a wider than necessary multiboard could be used for a variety of purposes.
 
Status
Not open for further replies.
Top