Skip to content

Mobile Refinery Logic #707

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

Closed
wants to merge 8 commits into from
Closed

Mobile Refinery Logic #707

wants to merge 8 commits into from

Conversation

NetsuNegi
Copy link
Contributor

@NetsuNegi NetsuNegi commented Jul 21, 2022

Techno can convert the ore under its feet into cash in real time, like GDI's EPIC unit MARV in Command & Conquer 3 Kane's Wrath. It also work on airforce unit.
This logic cannot work on buildings.

in rulesmd.ini

[SOMETECHNO]                          ; InfantryType, UnitType or AircraftType
MobileRefinery=no                     ; boolean
MobileRefinery.TransRate=30           ; unsigned int, how many frames are there between two conversions
MobileRefinery.CashMultiplier=1.0     ; float, it's multiplier of the final cash.
MobileRefinery.AmountPerCell=0        ; unsigned int, how many ore can be convert at one time in each cell
MobileRefinery.FrontOffset=           ; list of double, use cell as unit, multiple values mean that they are effective in multiple cells at the same time
MobileRefinery.LeftOffset=            ; list of double, use cell as unit, multiple values mean that they are effective in multiple cells at the same time
MobileRefinery.Display=yes            ; boolean, should it display translated cash ?
MobileRefinery.DisplayColor=57,197,187; RGB color
MobileRefinery.Anims=                 ; list of animations, if set 8 animations, it will select by techno's body facing, other amount will random select
MobileRefinery.AnimMove=yes           ; should the anim move as techno ?

8DVN 2X(GZX@49ZD}PJNN`3

@mevitar
Copy link

mevitar commented Jul 22, 2022

TransRate= and MaxAmount= need more explanation on what exactly they do, i had to figure it out by trial and error (they didn't do what i expected). Same for Offsets - are they in cells or leptons? (answer: leptons, but i had to figure it out myself)
And i don't think there's any point in making it in leptons, since you can't clear part of a cell anyway.

Otherwise appears to work fine, although i think outright clearing the cell is too much. It would be better if it instead reduced the tiberium on the cell by a specified amount. Or perhaps a rate at which it reduced each cell of its tiberium (defaulting to instantly?).

@NetsuNegi
Copy link
Contributor Author

TransRate= and MaxAmount= need more explanation on what exactly they do, i had to figure it out by trial and error (they didn't do what i expected). Same for Offsets - are they in cells or leptons? (answer: leptons, but i had to figure it out myself) And i don't think there's any point in making it in leptons, since you can't clear part of a cell anyway.

Otherwise appears to work fine, although i think outright clearing the cell is too much. It would be better if it instead reduced the tiberium on the cell by a specified amount. Or perhaps a rate at which it reduced each cell of its tiberium (defaulting to instantly?).

I'll add more info about that, and the offset will use cell, no longer leptons. And are you want a tag to limit the total convert ore value in one time when set multi cells?

@NetsuNegi
Copy link
Contributor Author

It's bad...

@NetsuNegi NetsuNegi closed this Jul 23, 2022
@NetsuNegi NetsuNegi reopened this Jul 23, 2022
@github-actions
Copy link

github-actions bot commented Jul 23, 2022

Nightly build for this pull request:

@NetsuNegi
Copy link
Contributor Author

TransRate= and MaxAmount= need more explanation on what exactly they do, i had to figure it out by trial and error (they didn't do what i expected). Same for Offsets - are they in cells or leptons? (answer: leptons, but i had to figure it out myself) And i don't think there's any point in making it in leptons, since you can't clear part of a cell anyway.

Otherwise appears to work fine, although i think outright clearing the cell is too much. It would be better if it instead reduced the tiberium on the cell by a specified amount. Or perhaps a rate at which it reduced each cell of its tiberium (defaulting to instantly?).

I misunderstood the function. I will fix MaxAmount soon.

@mevitar
Copy link

mevitar commented Jul 25, 2022

Tested this newer build and everything appears to work fine. However, since you changed how MobileRefinery.MaxAmount= works, the name might not be appropriate anymore. :P
Also, again, need better explanation what the tag reduces (cost value? tiberium stages? i assume it's tiberium stages as setting it to 1 reduced the patch 1 stage per each interval, up to 12 times on the richest cells).

I have an issue with how MobileRefinery.TransRate= works currently, though, as the timer appears to be counting all the time. That means, if the intervals are long enough. the unit can walk over a tiberium patch between the timer's intervals and nothing will be collected. IMO the timer should apply only while still occupying a cell (like standing still or moving very slowly), and once the unit moves to another cell the timer should reset and it should immediately collect MobileRefinery.MaxAmount= of tiberium.

But i feel that i'm already making too many request, so perhaps should wait for feedback from others before anything is changed. :P

@chaserli chaserli added Needs improvement Needs Update This branch needs to be updated with upstream for testing and reviews labels Dec 28, 2022
@chaserli chaserli marked this pull request as draft December 28, 2022 06:27
@NetsuNegi NetsuNegi closed this Jan 18, 2023
@mevitar
Copy link

mevitar commented Jan 18, 2023

Why has this been closed? Was there not enough feedback on this?

@NetsuNegi
Copy link
Contributor Author

Why has this been closed? Was there not enough feedback on this?

The code has not been updated for a long time. Now it is more troublesome to handle. Later, I will restart or open another pull request.

@mevitar
Copy link

mevitar commented Jan 18, 2023

Later, I will restart or open another pull request.

Good to hear that, i was afraid it was being abandoned.

@chaserli
Copy link
Contributor

chaserli commented Jan 19, 2023

  1. Too many new entries, in this case do it like [Minor] InterceptorType #787
  2. XXRate is in minutes, whereas XXDelay or XXDuration can be in frames, choose carefully
  3. If you're doing it in TechnoClass::AI, make it obey the same format as others. In fact I think from now on OnUpdate like actions should be considered carefully for performance consideration
  4. Please Implement AI logic, i.e. make it behave like harvesters for auto harvesting
  5. The XXRate thing is perhaps interpreted improperly. IMO it should be something like "I gathered this amount of ore and it will take this amount of frames to monetize". Hint: make use of the vanilla/Ares' storage properties.
  6. You should have just updated your branch and continued on that
  7. Do you really need more than 1 anim? Is it even reasonable that the anim is not attached to the object?

@NetsuNegi
Copy link
Contributor Author

Later, I will restart or open another pull request.

Good to hear that, i was afraid it was being abandoned.

I had recreate a new PR#1111 for this logic

@DeathFishAtEase
Copy link
Collaborator

Transfer to #1619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs improvement Needs Update This branch needs to be updated with upstream for testing and reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants