Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

New Infotypes and new display method

Open CrimRecya opened this issue 1 year ago • 8 comments

New InfoType: ROF timer, Reload timer, Spawn timer, Gattling timer, Produce cash timer, Passenger kill timer, Auto death timer, SW timer, IronCurtain timer, Temporal remainder.

  • If Shape.PercentageFrame set to true, it will only draw one frame that corresponds to total frames by percentage.
  • VisibleInSpecialState controls whether this display type will show when the owner is in ironcurtain or is attacked by a temporal weapon.

In rulesmd.ini:

InfoType=Health                         ; Displayed value enumeration (health|shield|ammo|mindcontrol|spawns|passengers|tiberium|experience|occupants|gattlingstage|ROF|Reload|SpawnTimer|GattlingTimer|ProduceCash|PassengerKill|AutoDeath|SuperWeapon|IronCurtain|TemporalLife)
Shape.PercentageFrame=false             ; boolean
VisibleInSpecialState=true              ; boolean

CrimRecya avatar Jun 23 '24 15:06 CrimRecya

I get the idea of having visuals of misc info on the techno. I would like to elaborate the plan/vision on "custom healthbar" here. We may want to choose between a bar or a digital display, or even to keep both. The idea is to redirect the drawhealthbar vtbl call completely, and draw both the bars and the "digital displays" there. We need to redesign a system with minimum overhead for this. I wonder if you can get the idea and help working on it

chaserli avatar Jun 23 '24 16:06 chaserli

I get the idea of having visuals of misc info on the techno. I would like to elaborate the plan/vision on "custom healthbar" here. We may want to choose between a bar or a digital display, or even to keep both. The idea is to redirect the drawhealthbar vtbl call completely, and draw both the bars and the "digital displays" there. We need to redesign a system with minimum overhead for this. I wonder if you can get the idea and help working on it

That's really good! Although I also really want to join, I haven't had much time in these months. So I only have these little features to share. Besides, I really don't know much about decompilation yet, so even if I have time, I'm afraid I won't be able to help much. Waiting the news of your success :)

CrimRecya avatar Jun 23 '24 16:06 CrimRecya

That's really good! Although I also really want to join, I haven't had much time in these months. So I only have these little features to share. Besides, I really don't know much about decompilation yet, so even if I have time, I'm afraid I won't be able to help much. Waiting the news of your success :)

Are you on our Discord channel? I am sure we can collaborate on that and help you :)

Metadorius avatar Jun 23 '24 19:06 Metadorius

That's really good! Although I also really want to join, I haven't had much time in these months. So I only have these little features to share. Besides, I really don't know much about decompilation yet, so even if I have time, I'm afraid I won't be able to help much. Waiting the news of your success :)

Are you on our Discord channel? I am sure we can collaborate on that and help you :)

I really want to join, but due to some special reasons, even if I use my VPN, I still cannot connect to Discord's server ;-( It seems like I need to change my VPN in the future when I have more time

CrimRecya avatar Jun 24 '24 04:06 CrimRecya

That's really good! Although I also really want to join, I haven't had much time in these months. So I only have these little features to share. Besides, I really don't know much about decompilation yet, so even if I have time, I'm afraid I won't be able to help much. Waiting the news of your success :)

No it's just a framework we need to establish and I think it would be better if you can help working on that rather than patching this one. Do you need some hint for what I was saying? Basically if you look into TechnoClass::DrawHealthBar you'll see there were too much overhead, the idea is that you use its nature of being virtual and rewrite 4 functions for 4 final technoclasses. For example

void __fastcall BuildingClass_DrawHealthbar_New(BuildingClass* self,void*,Point2D* loc, RectangleStruct* bounds, bool disguise)
{
Draw healthbar
Draw shieldbar
Draw ic bar
Draw temporal bar
Draw other bars...
Draw digital displays...
All these shit managed by a new framework

if(....)
drawpipscalepips
}
DEFINE_JUMP(VTABLE,0x7E4308, BuildingClass_DrawHealthbar_New)

chaserli avatar Jun 30 '24 08:06 chaserli

That's really good! Although I also really want to join, I haven't had much time in these months. So I only have these little features to share. Besides, I really don't know much about decompilation yet, so even if I have time, I'm afraid I won't be able to help much. Waiting the news of your success :)

No it's just a framework we need to establish and I think it would be better if you can help working on that rather than patching this one. Do you need some hint for what I was saying? Basically if you look into TechnoClass::DrawHealthBar you'll see there were too much overhead, the idea is that you use its nature of being virtual and rewrite 4 functions for 4 final technoclasses. For example

void __fastcall BuildingClass_DrawHealthbar_New(BuildingClass* self,void*,Point2D* loc, RectangleStruct* bounds, bool disguise)
{
Draw healthbar
Draw shieldbar
Draw ic bar
Draw temporal bar
Draw other bars...
Draw digital displays...
All these shit managed by a new framework

if(....)
drawpipscalepips
}
DEFINE_JUMP(VTABLE,0x7E4308, BuildingClass_DrawHealthbar_New)

Oh yes, I see what you mean. But I'm sorry I can't be of any help. As I mentioned before, I currently don't have so much time to finish a completely new function, so I just built these on what already have.

CrimRecya avatar Jun 30 '24 10:06 CrimRecya

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Jul 07 '24 19:07 github-actions[bot]

Those AutoDeath and SW ones definitely seem useful. Have you considered a way to define whether the SW display is for SuperWeapon/SuperWeapon2 or perhaps even an entry from the list of SuperWeapons? It would also be neat for SWs to have an option to display the actual timer rather than remaining time in % or seconds, if possible as an option.

Speederovsky avatar Aug 01 '24 08:08 Speederovsky

Any updates on this?

Speederovsky avatar Feb 20 '25 09:02 Speederovsky

ValueAsTimer seems to work quite nicely.

Speederovsky avatar Feb 25 '25 09:02 Speederovsky

Found no new issues so far. How's this looking?

Speederovsky avatar May 23 '25 09:05 Speederovsky