Phobos-developers / Phobos

Ares-compatible C&C Red Alert 2: Yuri's Revenge engine extension
GNU Lesser General Public License v3.0
254 stars 83 forks source link

New Infotypes and new display method #1287

Open CrimRecya opened 1 week ago

CrimRecya commented 1 week ago

New InfoType: ROF timer, Reload timer, Spawn timer, Gattling timer, Produce cash timer, Passenger kill timer, Auto death timer, SW timer. If Shape.PercentageFrame set to true, it will only draw one frame that corresponds to total frames by percentage.

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)
Shape.PercentageFrame=false             ; boolean
chaserli commented 1 week ago

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

CrimRecya commented 1 week ago

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 :)

Metadorius commented 1 week ago

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 :)

CrimRecya commented 1 week ago

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

chaserli commented 3 days ago

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)
CrimRecya commented 3 days ago

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.