Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance improvements #38

Closed
CptMoore opened this issue Jun 16, 2018 · 21 comments
Closed

Performance improvements #38

CptMoore opened this issue Jun 16, 2018 · 21 comments

Comments

@CptMoore
Copy link
Member

Cache engine def lookups
Cache engine, structure and armor types lookup

Test if more components hurt or are ok. Maybe allow factional engine tonnage calculations and make xl, lfe, etc just simple kits. Dewcriptions should dynamically change then during tooltips.

@Aliencreature
Copy link
Contributor

Could the IS/Clan identifier be handled similarly to the SHS/DHS internal sinks system? The differing versions (i.e. IS XL vs Clan XL) differ only in the required side-torsos and costs, and it would reduce the components in the enthusiast package to half.

A second idea I had on the bus was removing all side-torso parts and using only two, one for the left and one for the right, and requiring a certain number of them according to the engine. So an XL would require 3 left-side parts and 3 right-side, a light would need 2 and 2, etc.

@CptMoore
Copy link
Member Author

CptMoore commented Jun 19, 2018

That would be a bit less work than making all engine types inherently a kit. The issue here is the campaign though. For the campaign, to keep the immersion, those engines should stay individual items. For the mechlab it wouldnt matter, there i could even make the rating dynamic (kits or 100 50 5 increases..). Lets see what 1.1 does with the amounts. Maybe a hybrid thing? Engine rating come in classes 300-400) and you can modify the precise rating and type through kits?

I also had your second idea. Its not useful for the basic variant so I didnt do it.

Another idea went further by getting rid of manual management altogether and automate the adding and removal of the side torsos. That same code could also be applied to endo and ff. Problem this requires some code that likely can brake on game updates.

@CptMoore
Copy link
Member Author

the easiest thing was to reduce the exotic (and xl) count to 100 rating increments. the mechlab is much faster than before, so I'm confident in putting more increments for std engines.

I will log out what engines we have in use for stock and just include all those std variants only.

@CptMoore
Copy link
Member Author

in mechlab, 3.22s for 340 engine components (or was it 360), with disabled filtering of engine types its only 0.5s

@CptMoore
Copy link
Member Author

@Aliencreature what do you think, should I remove the standard/xl/etc.. engines and just make an engine that can be converted to XL, STD etc..? in combination with the new mechlab I'd have all engine ratings available without lag. problem is immersion suffers alot. suddenly every engineer can use an XL conversion kit to replace the engine. Maybe I just need a good description for that conversion kit (XL radiation shielding). But then what about the other engine types?

xl kit name - XL radiation shielding
compact kit name - compact radiation shielding
light conversion kit name - light radiation shielding

I'd use factional accounting to convert between the engine types weights.

@Aliencreature
Copy link
Contributor

I think it may be better to wait for a few patches to the main game before doing anything radical like that. On 1.1 and running both this mod (+exotics) and RogueTech I am not getting any game-breaking lag in the store or mechlab. The main problem is the clutter in the store, because it is hard to find a specific engine.

@CptMoore
Copy link
Member Author

CptMoore commented Jun 23, 2018

yea but what about +++ engines etc.. we will get a lot of more components and clutter when we start allowing rare engines.
having separate components helps with knowing the exact tonnage, but tbh I just put stuff onto the mech and then see what happens

@Aliencreature
Copy link
Contributor

Would the conversion kit method allow for mechs that come with XL engines stock? There are no such mods right now, but variants mods with post-Helm designs would really benefit from the ability.

@CptMoore
Copy link
Member Author

You would configure an engine using the SimGameUID. A SimGameUID of "/dhs+3shs+3dhs" means a dhs engine with 3shs and 3dhs (if mixed heatsinks are allowed). SimGameUIDs can be defined per components that are inside a mechdefs. if I would use the same mechanism for defining the engine type it should technically work. SimGameUID could be "/dhs-xl+3shs+3dhs", where the xl would stand for the type of the engine,

If I could an arrow up and arrow down somewhere, I could even make the rating part of SimGameUID and we don't even need an engine component per rating. Of course changing the rating will cost a lot of money.

@Aliencreature
Copy link
Contributor

If it plays well with salvage AND you can configure the engines using the SimGameUID, I don't see why not to run with it!

@CptMoore
Copy link
Member Author

well, in lore each engine type + rating is its own component, so that is still my main factor of not doing it dynamically.

Do we have other ideas on how to reduce clutter? Like only show engine ratings that actually have different stats? (like if there is an engine 385 and 390, and both have the same stats but 390 is heavier, just hide 390?)

@CptMoore
Copy link
Member Author

salvage wouldn't include an xl engine but an engine and xl shielding materials

@Aliencreature
Copy link
Contributor

That depends a lot on what kind of clutter you want to reduce.

If it is store clutter, then in the release we just need to make sure engines in stores are not ever-present as they are now, so ideally you have a choice between 4-5 STD engines on each planet and a chance of a rare XL/cXL/XXL/cXXL/Compact appearing.

If it is item file clutter, your idea has a lot of merit. Another would be to have 4 main engines of each type (100, 200, 300, 400) and use the UID to give them increments.

@CptMoore
Copy link
Member Author

yea store clutter and to an extend campaign clutter is no problem, as you would sell those engines anyway and don't have as many. ok doesn't make sense to move engines types and/or ratings to SimGameUID because of the campaign.

So I'm just concerned about skirmish mechlab clutter. Having actual items is not the real issue I guess, it's having to display them all and scrolling, and scrolling. Maybe some custom filtering of the components? Oh or better, just have a conversion kit for the engine types and have the real thing. the conversion kits actually replace the engine with the component of another type but the same rating. That mechanism only works in the mechlab. For the campaign you have to get the real items and the conversion kits don't exist.

I'll check how doable that is.

@Aliencreature
Copy link
Contributor

Ideally there would be more filtering options, but I think those rely on enums that can't yet be modified through Harmony. But your solution works as an alternative, if it's doable.

@CptMoore
Copy link
Member Author

CptMoore commented Jun 23, 2018

damn, I can dynamically reduce the tonnage of an engine, but the compact engine actually requires less space which I could only simulate by adding a dummy component for all other engines and requiring that to be added.

I'm splitting the engine up to 2 required components:

  1. engine core, one item per rating. supports conversion to DHS and additional heat sinks
  2. shielding, one item per engine type. provides a tonnage multiplier to the standard engine. also adds space requirements (through own size or side torso elements).

engine core will be 2 slots
shielding will be 1-4 slots + 2-6 slots per side torso

this allows to have full immersive components that can be salvaged and put onto mechs, with nice descriptions etc, while still allowing to do combinatorics without huge item lists.

Fusion Multiplier
Standard 1.0
Compact 1.5
Light 0.75
XL 0.5
XXL 0.333

Unfortunately this is a major rewrite of all my logic as I only support one main engine in the center torso. But I think its worth it as it actually increases immersion, avoids cluttering and opens up more variants.

Should I make the shielding material also heatsinks or should I move them to upgrades? Lore and gameplay wise makes more sense to have them as upgrades, but the mechlab filter would suggest heatsinks. (I would move the side torsos parts also to upgrades)

@Aliencreature
Copy link
Contributor

To be fair, if there is one engine type that could be cut without anyone noticing, it is Compacts. Unless we balance them with some impressive bonuses, the weight cost is just not worth it and nobody will ever use them.

But I like it. It is a little more 'gamey', but the Battletech game is not a perfect translation of tabletop anyway.

I'd say that the shielding material should be in the upgrades, simply because the heatsink tab will be too cluttered with all the ratings.

Something else I've been wondering is if it is possible to add a "heatsink multiplier" in the enginedefs, like how weight savings are defined for armor. Right now my implementation of the XXL heat is a bit clunky, and it might be more elegant to have it sink less heat instead of producing 15 at the end of each turn.

@CptMoore
Copy link
Member Author

I just did the split, no move to upgrades though. I make that another issue.

your XXL mod is something that could be fixed by allowing heatdissipation from heatsinks to be active. I made a the code changes (no json changes yet) but it might not work.

@Aliencreature
Copy link
Contributor

Testing the base package now, everything seems to be in order in skirmish. The SLDF mechs receive DHS engines, as they should. Their engine ratings are still not lore correct, but that's due to how their loadouts are in the game and how much tonnage they leave for the internals. Going to test the exotics next.

@CptMoore
Copy link
Member Author

yea I found out that by changing the SLDF mechs to use XL engines and removing shs I can get a performance that fits.

@CptMoore
Copy link
Member Author

I think the conversion was a success, so the most pressing performance issue was solved

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

No branches or pull requests

2 participants