Enhanced Balance Mod for 3.x

Did you create a mod, map, music, or a tool? Present them here and earn feedback!
Note: addon requests do not belong here.
Note, everything uploaded to this forum, MUST have a license!
User avatar
Prot
Trained
Trained
Posts: 167
Joined: 29 Nov 2010, 12:41

Re: Enhanced Balance Mod for 3.x

Post by Prot » 23 Jan 2018, 21:38

Im not strong enought in c++ and i waste all day for hunting this bug.. I put many debug outputs in design.cpp in different places, and already find where stats still normal, and where already broken.. And im not agree, this is bug. Becouse in design right widget stats is normal, but then it broke. I think im close to find this bug, tomorrow, now late time, got to sleep.

User avatar
Prot
Trained
Trained
Posts: 167
Joined: 29 Nov 2010, 12:41

Re: Enhanced Balance Mod for 3.x

Post by Prot » 24 Jan 2018, 08:37

Found it, fix it.
Now clean my code and prepare pull request.
..phew

UPD:
Testing the game, it works: https://youtu.be/Tq8rj58_w7I
Also testing multiplayer.
Creating pull request: https://github.com/Warzone2100/warzone2100/pull/110
I hope the patch will take, though it affects the engine and a bit of network code.

Please fix those bus where constructors build Labs without orders)) Now I want to play more this mod =)
And keep developing this mod, if they accept the patch. Now you will be available 65536 parts guns instead of 256 ;)

MIH-XTC
Trained
Trained
Posts: 253
Joined: 31 Jan 2014, 07:06

Re: Enhanced Balance Mod for 3.x

Post by MIH-XTC » 24 Jan 2018, 14:51

Prot wrote:Found it, fix it.
Now clean my code and prepare pull request.
..phew

UPD:
Testing the game, it works: https://youtu.be/Tq8rj58_w7I
Also testing multiplayer.
Creating pull request: https://github.com/Warzone2100/warzone2100/pull/110
I hope the patch will take, though it affects the engine and a bit of network code.

Please fix those bus where constructors build Labs without orders)) Now I want to play more this mod =)
And keep developing this mod, if they accept the patch. Now you will be available 65536 parts guns instead of 256 ;)
Thanks a lot, I owe you big time. I was looking for a 256 array, not an 8 bit integer that creates a 256 array :) . I did grep for MAX_WEAPONS so it bothers me I did not catch 8 bit integer but I'm not setup to debug WZ with debug/print statements.

I will most definitely continue to make this mod. I will push changes to prevent AI from building cyborg factory later today.

BTW, Nexus always truck rush after it has built at least 3 derricks on map size < 120 and gameTime is < 6 minutes.

After it has 3 derricks it loops through all oil resources to find one with enemy truck within 6 tiles. 90% of time this is an oil in opponents base (but could be anywhere). Then Nexus will go to that oil and try to build a derrick or a tower if the opponent has built derrick there.

Technically this is cheating (loops through unseen oils) but it's the most convenient way to tell Nexus to truck rush like a human without having to go into complicated algorithm that does not loop through oils.

User avatar
Prot
Trained
Trained
Posts: 167
Joined: 29 Nov 2010, 12:41

Re: Enhanced Balance Mod for 3.x

Post by Prot » 25 Jan 2018, 15:35

After last mod update, i have again crash. Strange, what you change in the mod? May be there somewhere memory overflow.. Hmm.

MIH-XTC
Trained
Trained
Posts: 253
Joined: 31 Jan 2014, 07:06

Re: Enhanced Balance Mod for 3.x

Post by MIH-XTC » 25 Jan 2018, 16:46

Prot wrote:After last mod update, i have again crash. Strange, what you change in the mod? May be there somewhere memory overflow.. Hmm.

It could be because you have scavs on. For some reason ultimate scavs are causing UNIX users to crash. In windows there are no errors.

Other than that, I don't know, it shouldn't crash.... It worked for me in UNIX before I went to bed last night.

I will let you know when ultimate scavs are working in UNIX, hopefully today or tomorrow.


Also, I need to create a dev branch so that this doesn't happen instead of pushing directly to master. Still getting used to Git.

On another note, I fixed line ending problems in Github so that people can actually read what changes I'm making to stats. I need to get into the habit of mapping 1-to-1 commits to features. Right now I make a commit and I change so much stuff that I can't even remember what I changed until I look at the diff afterwards.

User avatar
Prot
Trained
Trained
Posts: 167
Joined: 29 Nov 2010, 12:41

Re: Enhanced Balance Mod for 3.x

Post by Prot » 25 Jan 2018, 19:42

Yeah, crash it's because scavs.. I needed to see exactly how and where the game crash.

Well, this nexus one really badass. I'm playing about a hour loss again, and i think even 20% of all research not completed.
And he really not cheat? Do not adds money, does not add units himself, not speed up research?

MIH-XTC
Trained
Trained
Posts: 253
Joined: 31 Jan 2014, 07:06

Re: Enhanced Balance Mod for 3.x

Post by MIH-XTC » 25 Jan 2018, 20:17

Prot wrote:Yeah, crash it's because scavs.. I needed to see exactly how and where the game crash.

Well, this nexus one really badass. I'm playing about a hour loss again, and i think even 20% of all research not completed.
And he really not cheat? Do not adds money, does not add units himself, not speed up research?

That's because in WZ, the strategy is really simple actually. Strategy only consists of 4 components, the first 3 are hard coded for most optimal game play.

base build order
research order
droid design
unit control

I made Nexus have best base build order for stats. The research order is just a static array for each weapon line (Nexus.vlo) and same thing for droid design, it's a static array of best designs for a given weapon line.

So therefore Nexus has ~best research possible (without cheating), ~best droid designs and ~best base build for 90% of games just using static arrays in Nexus.vlo. Choice of weapon is somewhat random so that each game can have different outcome.

The last component "unit control" is by far the hardest to program for an AI. Telling a droid how to move based on opponent is difficult. Instead, I just check if there are >7 combat droids not doing anything. If there are more than 7 idle droids then they just spam to enemy base. That's it. Their DORDER is to attack anything insight so they attack anything in their path. Grenadiers are really good for this because they have longer range. Grenadiers dominate AI vs AI game.

And that's it. No extra power, units or research or anything.

So basically Nexus just spams units non-stop to closest enemy, there isn't any unit control finesse, just spam.

One difference maker might be because I made repair droids much stronger and Nexus knows how to use retreat and repair droids. I actually got this idea from bonecrusher :) I noticed Bonecrusher using repair really good.

I suggest you try autogame with Nexus. You have to rename yourself "Nexus" and when game starts, do "cheat on" "autogame on" and you can observe how Nexus plays. This is how I do 100% of all my testing, using autogame simulations.

I don't know if you notice but there is more power in these stats and Nexus knows how to spend extra power really fast. I also notice in your video you are not using cyborgs and you are dieing with a lot of power. You can make 10 cyborg factories.

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 640
Joined: 26 Sep 2016, 19:56

Re: Enhanced Balance Mod for 3.x

Post by Berserk Cyborg » 26 Jan 2018, 01:12

MIH-XTC wrote: It could be because you have scavs on. For some reason ultimate scavs are causing UNIX users to crash. In windows there are no errors.
Does this happen with ultimate-scavs all by itself, or does it only happen when combined with EB? I have been looking through your changes and merging in anything that works where possible (among other commits making mp changes in the official repo) and noticed it would freeze forever (first time I saw this), but would not cause Windows to freak out and say there was a problem. The last time I encountered something like that was when I accidentally caused an infinite loop with VTOLs with an older version of semperfi-js. Oddly, I added some missing * into the scav body names and have yet to see a crash again, if that does anything.

On a completely unrelated note, do you know how to modify Nexus and SemperFi scripts to automatically give them the cyborg repair component? There is a fix for repair cyborgs appearing too early, but removing a makeComponentAvailable() in rules.js causes the wzscript AI's to assert since they don't actually research mobile repair.

MIH-XTC
Trained
Trained
Posts: 253
Joined: 31 Jan 2014, 07:06

Re: Enhanced Balance Mod for 3.x

Post by MIH-XTC » 26 Jan 2018, 02:05

I just fixed the scavs causing crash in UNIX, deb8475a56a9769e0cd6050db7214971e6e3d2e2 it's because they were trying to enable a sensor turret (that I enabled, oops).

So I check the logs, in UNIX... and WOW. No wonder it's easy to debug things, there are callbacks and such. In windows nothing is logged and even when it is, it's not nearly as verbose. I would've never figured this out if it wasn't clearly stated in the logs that js_makeComponentAvailable is causing an error.

MIH-XTC
Trained
Trained
Posts: 253
Joined: 31 Jan 2014, 07:06

Re: Enhanced Balance Mod for 3.x

Post by MIH-XTC » 26 Jan 2018, 02:18

Berserk Cyborg wrote:
On a completely unrelated note, do you know how to modify Nexus and SemperFi scripts to automatically give them the cyborg repair component? There is a fix for repair cyborgs appearing too early, but removing a makeComponentAvailable() in rules.js causes the wzscript AI's to assert since they don't actually research mobile repair.

I think that's because Line 1853 Nexus.slo doesn't check if cyborg mechanic has been researched (just assumes so) before attempting to produce it (Null object). If you wrap line 1853 with

if(skCanBuildTemplate(me,_factory, cybMechanic))
{

}

I think that should fix it. If it doesn't let me know.
(see line 1861 for example)

EDIT: To answer your question directly, nothing is enabled from nexus.slo or nexus.vlo, it relies on rules.js.

User avatar
NoQ
Special
Special
Posts: 6197
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Enhanced Balance Mod for 3.x

Post by NoQ » 26 Jan 2018, 04:32

AIs should only be able to give valid orders, same as players, and they should be unable to do anything else without causing a desync in multiplayer. Because if AIs are allowed to give themselves research, humans would also be able to do that in multiplayer by substituting AI scripts to do whatever they need, because AIs are only run on the host machine.

Just in case.

MIH-XTC
Trained
Trained
Posts: 253
Joined: 31 Jan 2014, 07:06

Re: Enhanced Balance Mod for 3.x

Post by MIH-XTC » 27 Jan 2018, 20:39

Prot wrote:I'm playing about a hour loss again, and i think even 20% of all research not completed.

You bring up a good point. I made research slightly slower than 3.1.5 in T1 no base 14 --> 12 but this was before adding extra models from other mods. Now with more stuff to research, I made research faster than normal 14 --> 20 b8bcde2b42ad4d943b236d7a2481d1b97ce8201e and I think it will make the gameplay more enjoyable.

User avatar
Berg
Regular
Regular
Posts: 2044
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Enhanced Balance Mod for 3.x

Post by Berg » 28 Jan 2018, 05:47

It would be nice to see your model list in screenshots.
Just out of curiosity because as you stated the menu for these things dont work

MIH-XTC
Trained
Trained
Posts: 253
Joined: 31 Jan 2014, 07:06

Re: Enhanced Balance Mod for 3.x

Post by MIH-XTC » 28 Jan 2018, 16:11

Berg wrote:It would be nice to see your model list in screenshots.
Just out of curiosity because as you stated the menu for these things dont work

Yes thanks for bringing this up, when using alt+a with debug mode (unlock everything) the menus are maxed out. The build menu and weapon design menus do not display all of the structures/weapons which makes it harder to test things. The research menu is not too concerning.


The fix is updating 2 constants

Line 72 design.cpp MAX_SYSTEM_COMPONENTS 128 -->512

Line 222 hci.h MAXSTRUCTURES 200 -->512

Can one of the devs make the change or must I use some of those non-intuitive git commands to communicate this :augh:

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 640
Joined: 26 Sep 2016, 19:56

Re: Enhanced Balance Mod for 3.x

Post by Berserk Cyborg » 28 Jan 2018, 19:26

MIH-XTC wrote: Can one of the devs make the change
Forgon made the necessary changes in the latest commit cef6b6a5a570bb3d26e8fff60377b2706aec80a6.

Post Reply