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

Unit shields #69

Closed
reubene opened this issue Oct 29, 2023 · 11 comments
Closed

Unit shields #69

reubene opened this issue Oct 29, 2023 · 11 comments

Comments

@reubene
Copy link
Collaborator

reubene commented Oct 29, 2023

Currently the units have no shields, this should be interface dependent since they are different in civ2 and TOT. Perhaps some sort of GetUnitTexture method on the active interface

@axx0
Copy link
Owner

axx0 commented Nov 13, 2023

Unit shields should be displayed correctly, but only for civ2. I'll try to set it up for TOT but I'm having trouble testing it since that interface is understandably throwing a bunch of errors when trying to run it.

@reubene
Copy link
Collaborator Author

reubene commented Dec 15, 2023

Are you still working on the TOT shields?
I was starting on the supported units view for cities and these areas overlap. If you're working here I'll hold off and find something else to look into.

@axx0
Copy link
Owner

axx0 commented Dec 15, 2023

Go ahead. I was planning to but I'm bogged down by TOT load and new game logic stuff.

@reubene
Copy link
Collaborator Author

reubene commented Dec 19, 2023

I've merge my changes in this area, we should probably move the actual shield image code to the interface so we can implement differently for TOT and MPG.

@axx0
Copy link
Owner

axx0 commented Dec 19, 2023

There's the part for reading shields in UnitLoader and there's the part for drawing them.
So both should be separate methods in the TOT and MGE interfaces?
Ok, I'll see what I can do since this part is actually preventing me from loading TOT games.

@reubene
Copy link
Collaborator Author

reubene commented Dec 20, 2023

Yes since TOT doesn't care about flag locations etc I think these need to be seperate

@axx0
Copy link
Owner

axx0 commented Dec 22, 2023

I've managed to get TOT shields working.
A couple of things left to do: draw TOT shields on top of units (unlike mge) and shield colouring (it's not as simple as in mge).

Question - I left GetUnitTextures method in RaylibUI and haven't moved it to interfaces. I can do this but it would require referencing RaylibUI in interfaces. Do we want to do this or in general try not to put UI into Core/Interfaces, so they only communicate through Model?
I hope you understand what I mean.

@reubene
Copy link
Collaborator Author

reubene commented Dec 23, 2023

I think the question has to be how generic GetUnitTextures is, Is it something a hard code modder would want to implement a different version of in order to support some really funny civ variant(Such as Call To Power) or is it a core part of the render pipeline?

I think there is very little chance anyone would ever need to mod GetUnitTextures beyond the flexibility you've just introduced. It's probably fine to leave it in the RaylibUI.

I definitely want to keep UI stuff out of core at some point I'd like to implement multiplayer via a pitboss server.

It would probably be okay to reference RaylibUI from an interface although I think that would be a code smell so we should probably avoid it.

@axx0
Copy link
Owner

axx0 commented Dec 23, 2023

There's a general dissatisfaction the way shields are implemented in TOT. For instance you can't easily change the colours of front/back shields since the game automatically darkens them.

I'll try to refine what I did by enabling as many parameters to be changed in the interface. For instance whether the shields should be rendered in front or in back of unit, etc. But the GetUnitTextures will be in the UI and communicate with the interface only through Model parameters.

And in the future I'll try to keep Raylib_cs & RaylibUI out of interfaces (if it's possible).

@reubene
Copy link
Collaborator Author

reubene commented Dec 23, 2023

I think Raylib_cs is probably okay in interfaces some things need to be drawn interface specific, but it's better to define params and draw in UI as it will make it more reusable and modable

@axx0
Copy link
Owner

axx0 commented Dec 23, 2023

Ok, that's what I did, shield drawing params can be easily changed in the interface now, the drawing itself is done only in UI.

Shield drawing is now done.

@axx0 axx0 closed this as completed Jan 25, 2024
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