Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Droid Design screen can only handle max 128 turrets #4677

Closed
wzdev-ci opened this issue Dec 1, 2017 · 17 comments
Closed

Droid Design screen can only handle max 128 turrets #4677

wzdev-ci opened this issue Dec 1, 2017 · 17 comments

Comments

@wzdev-ci
Copy link
Contributor

wzdev-ci commented Dec 1, 2017

resolution_fixed type_bug | by MIH-XTC


http://forums.wz2100.net/viewtopic.php?f=49&t=9493&p=139172#p139170

When loading turrets from weapons.json, the 129th designable turret overflows to the first when previewing the droid design screen.


Issue migrated from trac:4677 at 2022-04-16 12:57:42 -0700

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 1, 2017

Berserk Cyborg changed blocking which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 1, 2017

Berserk Cyborg changed blockedby which not transferred by tractive

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 1, 2017

Berserk Cyborg commented


Wonder if changing MAX_SYSTEM_COMPONENTS in design.cpp (line 72) would do the trick. I do not have access to a mod with that many weapons though.

https://github.com/Warzone2100/warzone2100/blob/master/src/design.cpp

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 1, 2017

Per commented


129 turrets?? Why?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 2, 2017

MIH-XTC commented


For porting contigency mod into 3.2.x

The mod has approximately ~165'ish total unique weapon turrets but only 128 are designable. The rockets are the best example. The mini-pod is not designable even when there are only 3 turrets choosable from the menu because alphabetically it's loaded after turret 128 from weapons.json. This mod has same problem in 3.1.5 so apparently it never worked properly.

I'd like to make a nice set of stats for this mod but this is a blocker. I think Jeff is right about MAX_SYSTEM_COMPONENTS. Can we try 128 --> 256?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 2, 2017

MIH-XTC commented


I added a partially ported contingency mod to the forum that this can be tested on in 3.2.3

http://forums.wz2100.net/download/file.php?id=17088

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Dec 8, 2017

Berserk Cyborg commented


Guess that was only part of the problem. From what I can tell, the overflow is happening around the rail gun weapons in the mod's weapons file. Putting the limit around 256 components.

@wzdev-ci
Copy link
Contributor Author

vexed changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

vexed changed resolution from `` to closed

@wzdev-ci
Copy link
Contributor Author

vexed commented


You would need to re-write the UI code as well...

This isn't a bug, just a engine limitation.

If anyone wants to change the behavior of this, feel free to make a patch, and open a new ticket.

Closing this, as it isn't a bug.

@wzdev-ci
Copy link
Contributor Author

Prot EuPhobos <prot@...> commented


In Warzone2100/warzone2100@c05e4f7:

#CommitTicketReference repository="" revision="c05e4f7851d7f6ab7631b11b81ee9c333cab58cd"
Changes int8 to int16 in serializers

to pass more than 256 weapons parts in game engine logic
fixing bug #4677

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> changed owner from `` to Forgon2100 <forgon2100@gmail.com>

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> changed resolution from closed to fixed

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> committed [865]


In Warzone2100/warzone2100@865e255:

#CommitTicketReference repository="" revision="865e255fe68b0213c464320c379bf30f68930476"
Merge pull request #110 from EuPhobos/bugfix/droid_design_weap

fixes #4677: Changes some int8 to int16 in serializers

@wzdev-ci
Copy link
Contributor Author

Forgon2100 <forgon2100@...> commented


In Warzone2100/warzone2100@cef6b6a:

#CommitTicketReference repository="" revision="cef6b6a5a570bb3d26e8fff60377b2706aec80a6"
fixes #4723: increase capacity of design, build and research screens for EB mod (amends #4677)

as requested by MIH-XTC a.k.a. Calculus:
- design screen can now display 512 components (previously 128)
- build screen can now display 512 structures (previously 200)
- research screen can now display 600 topics (previously 200)

@wzdev-ci
Copy link
Contributor Author

Cyp commented


Haven't tested, but I'd guess that uint8_t asParts[DROID_MAXCOMP]; should maybe be changed, too.

I think int8_t numWeaps; didn't need to be int16_t, although an unsigned type would make more sense.

Changing uint8_t asWeaps[MAX_WEAPONS]; to uint32_t instead of uint16_t might save a few bytes over the network (not that it matters), since small uint32_t values are sent as single bytes.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Feb 8, 2018

Prot EuPhobos <prot@...> committed [3]


In Warzone2100/warzone2100@3a729d9:

#CommitTicketReference repository="" revision="3a729d9568b1a06e733651efc08003e601b5846c"
Fix #4677

Bumped up MAXSTRUCTURES and MAXRESEARCH to display more parts in widgets
Return numWeaps int16_t back to int8_t as Cyp recommended and it works.
Change asWeaps uint16_t to uint32_t to save some bytes in the serializer
Briefly tested, seems to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant