<< Back to Programming Forum   Search

Posts 1 - 20 of 23   1  2  Next >>   
custom distribution not working in multiplayer: 12/10/2021 20:17:41


Just_A_Dutchman_ 
Level 60
Report
https://github.com/JustMe003/WarzoneMods/tree/main/randomized_nonograms

I've been developing a new mod lately, a mod for a specific map (a 20x20 nonogram) that creates a random nonogram and uses existing bonuses to show the puzzle to the players. Everything worked pretty well untill I decided to add one more feature to it.

When the host enables the option 'custom distribution' in the mod configuration the game will be set to manual distribution, and the mod overwrites the standing to only make the bonuses that will grant players income pickable.

This is what it looks like in singleplayer:

it works just fine, as expected

This is what it looks like in multiplayer:


few notes:

  • Both games had almost the same exact settings
  • Both games had full distribution
  • The dimensions of the puzzle(s) are meant to be different, this is an feature of the mod
  • The bonus values left and on the top are different, this is because the puzzle is random every time

As you can see, in singleplayer it works perfectly fine. I was quite shocked and didn't notice it first in multiplayer when I started testing it. I've tried all kind of small modifications, replaced a loop-end which made another loop run 400 times instead of once but couldn't fix it myself.

All the code you'll (should) need to see to fix this issue is in the file Server_StartDistribution.lua (https://github.com/JustMe003/WarzoneMods/blob/main/randomized_nonograms/Server_StartDistribution.lua)
custom distribution not working in multiplayer: 12/10/2021 23:46:45


TBest 
Level 60
Report
Maybe silly, but trying your GitHub link I get an error when making the mod available in Mulitplayer (ie turning off "Development")

https://github.com/JustMe003/WarzoneMods/blob/main/randomized_nonograms

It seems like my warzone client expects "master" not "main". So that makes me wonder if you ever pointed to github for your mod? If you did not, and is only pointing to local Dir. then this sounds like expected behavior. (Then again, you put your code on github so :smile: maybe something else)

(And that master/main thing, should probably be reported to Fizzer. Since main is what's used now EDIT: Sent a bug report)

EDIT: I guess writing in /master instead works, since github redirects. Seems so at least, so a good workaround.

Edited 12/10/2021 23:54:23
custom distribution not working in multiplayer: 12/10/2021 23:59:05


TBest 
Level 60
Report
I tried to use the mod in SP, but got this error when creating a game on the map :

MyCoroutine_Canvas: Warzone Server returned OverriddenBonusesInvalid nox
Warzone Server returned OverriddenBonusesInvalid nox


Don't have time to look more at the moment.

PS: If you have a template/game link to grab settings from, that might help eliminate some variables maybe.

Edited 12/11/2021 00:00:43
custom distribution not working in multiplayer: 12/11/2021 05:45:09


Just_A_Dutchman_ 
Level 60
Report
if i remember correctly the error occurs when you try to override a bonus ID that doesn't exists

here's the SinglePlayer template i use for testing
https://www.warzone.com/SinglePlayer?TemplateID=1420032

ps. I'll look into the master/main issue later on
custom distribution not working in multiplayer: 12/11/2021 13:45:05


TBest 
Level 60
Report
Ah, you are using a not yet public map, called "Randomized nonogram map" 😅
I was trying with "https://www.warzone.com/Map/41759-Nonogram" which probably explains the error. Was too late last night for me to realize the map did not at all match your screenshot :D

Now it also work in SP for me, and I can't immediately see why MP would not work. One thing I would try, is using -2 and 0 instead of WL.PlayerID.AvailableForDistribution and WL.PlayerID.Neutral. Not that this should matter thru, according to documentation both work. But I used -2 before, and I think I picked -2 for some reason. (Can't remember why thru.) Will try to check some more later today, just got to see if I can still set up AISever Bot for some free MP Mod test games :)
https://www.warzone.com/Profile?p=7263394758


ps. I'll look into the master/main issue later on

I reported it to Fizzer, so I would not bother looking more at it. In practice it's just a UI error that new modders might run into (You already point to /master github, so that part looks good as well).
custom distribution not working in multiplayer: 12/14/2021 01:11:02


Just_A_Dutchman_ 
Level 60
Report
first few tests again resulted in the same results, changed WL.PlayerID.AvailableForDistribution to -2 and didn't work.

But I was able to set a territory (id=400) to pickable, just tried to do it hard coded and it works
Doing one last test atm

Edited 12/14/2021 01:11:23
custom distribution not working in multiplayer: 12/14/2021 01:18:54


AbsolutelyEthan 
Level 63
Report
Sorta unrelated, but your mod is very cool. I once tried that sort of thing as a map, where players would turn on bonuses to make their own puzzle, but gave up. Your mod is a much better idea.
custom distribution not working in multiplayer: 12/14/2021 01:24:49


Just_A_Dutchman_ 
Level 60
Report
tx, i have been developing it for 2 months now, this is the last big problem before I start mass testing this mod. would you like an invite?
custom distribution not working in multiplayer: 12/14/2021 01:25:32


AbsolutelyEthan 
Level 63
Report
sure
custom distribution not working in multiplayer: 12/15/2021 15:00:48


Just_A_Dutchman_ 
Level 60
Report
Big chance I found the issue. I currently filling a table while creating the distribution with things I would normally print to output it in the mod menu. I found that (only did 1 test so far) when looping over the bonuses it started with bonus 241 which would initiate a break of the loop for practical reasons.
custom distribution not working in multiplayer: 12/17/2021 15:49:44


Just_A_Dutchman_ 
Level 60
Report
I've got i working. It was the break in the loop that looped over the bonuses for the territories. On your client it would loop over the territories in numeric order (1, 2, 3, 10, 11, 21, etc), but on the server it started with 241 for some reason triggering the break

I now have removed the break and it works perfectly
custom distribution not working in multiplayer: 12/17/2021 18:14:40


TBest 
Level 60
Report
Glad you got it working :)
custom distribution not working in multiplayer: 12/17/2021 18:21:26


krinid 
Level 62
Report
He might have fixed the issue I got stuck with on the Limited Multiattack problem too. If he fixes that, I'm voting Dutch for Pres.
custom distribution not working in multiplayer: 12/17/2021 19:07:18


Just_A_Dutchman_ 
Level 60
Report
don't get to far ahead. I did send Dabo1 a version of the mod with the bug fix, but he still has to review it and commit it to the main branch. I did get in touch with him tho so just waiting till I get a response
custom distribution not working in multiplayer: 12/17/2021 19:10:32


krinid 
Level 62
Report
Fyi, I talked to him earlier (10-13 months ago?) and he had no interest in working any further on it & had no issues if I published a revision on it to address that. Just I got stuck and stopped putting cycles into it. TBest helped for a while but he couldn't figure out a way around it either. I did have an idea on how to overcome it but it's not really a good method so just halted. Meant to go back and take another crack at it, but hey, I'm lazy and never did. LOL. If you've fixed it now, fantastic, would love to start testing/using it!

On that point ... is it tested? Even if Dabo does revive himsef and is good to publish it, make sure it actually solves the existing problem and doesn't introduce new ones before publishing it.
custom distribution not working in multiplayer: 12/17/2021 19:12:46


Just_A_Dutchman_ 
Level 60
Report
only tested it a bit in single player, but in theory it should work perfectly.

i can put the mod on GitHub and invite you to some test game

Edited 12/17/2021 19:14:03
custom distribution not working in multiplayer: 12/17/2021 19:15:22


Just_A_Dutchman_ 
Level 60
Report
He did say he didn't know anything about the bug, but that he would change the code when he reviewed it since I had the solution already
custom distribution not working in multiplayer: 12/17/2021 19:20:30


krinid 
Level 62
Report
Nice. That's the difference I suppose, when I contacted him, I didn't have the fix yet.

Btw, I did inform him of the bug, so he did knew about it. (;

Guess he just forgot. But don't suspect he's played with the mod enough to have witnessed it himself - which would be 1 full game (where you're paying attention to either moves you made that aren't happening, or see all the "Move skipped by mod" notes in the game history), that's all it takes to see the bug.

But back to the question - have thoroughly has this been tested? How do you know it fixes the issue without introducing new issues?

And HOW DID YOU FIX IT? I was unable to get the prevent the game from stopping the transfers, the core MA game code took precedence over my mod code.
custom distribution not working in multiplayer: 12/17/2021 19:29:50


Just_A_Dutchman_ 
Level 60
Report
I'll break it down on how his and mine version works in pseudo code.

if attack/transfer is succes then
	if owner of territory from is unequal to owner of territory to then
		#this is an attack, when both sending and receiving territories are occupied the same player it is a transfer
		set table value (territory to) to table value (territory from)
	#his version had an else statement
	#else
		#set table value (territory to) to -1 
		#which would cancel every attack transfer from this territory
	end


maybe the forum isn't the best place to it xD

Edited 12/17/2021 19:30:21
custom distribution not working in multiplayer: 12/17/2021 19:36:44


Just_A_Dutchman_ 
Level 60
Report
The code only checks if the GameOrder was an GameOrderAttackTransfer. It does not distinguish the difference between an attack and a transfer, that is done later. If an transfer happened he would just eliminate all moves from that territory by setting the value corresponding the territory to -1.

I removed that part of the code and changed another if statement (now that I'm looking at it I think they can be merged) to also distinguish attacks from transfers since I had another small issue where I was only able to attack the maximum multi attacks - 1 because I transfered to the territory my attack chain started before attacking
Posts 1 - 20 of 23   1  2  Next >>