CheeseLord / warts

WAcky Real Time Strategy
MIT License
1 stars 0 forks source link

Client graphics does too much #34

Closed CheeseLord closed 7 years ago

CheeseLord commented 7 years ago

Separate things out.

kronmillerg commented 7 years ago

Working on a branch, graphics-cleanup, to fix a lot of this by having the graphics just work with "entities" with little or no knowledge of whether they're units vs. ground, mine vs. someone else's, etc.

kronmillerg commented 7 years ago

Next step is to merge addGround into addEntity, which probably means having regular models go through the same dynamic sizing logic. Probably means we need to have actual sizes for everything in unit coordinates.

After that, implement moveEntity, which will have to deal with animation.

After that, I think we can get rid of the old addObelisk/removeObelisk/etc. logic and just use the entities instead.

kronmillerg commented 7 years ago

We are now adding, removing, and moving entities, which aren't associated with units in the graphics (rather, the graphics interface keeps track of a mapping). Currently these are maintained in addition to the obelisks; due to a difference in z coordinates, this creates a "chicken fight" effect.

The next step is to remove the old-style obelisks and fix the "chicken fight" effect. We can't simply remove the calls yet, because the backend depends on the graphics to tell it where units are for unit selection and the graphics needs its obelisk mapping to be maintained in order to do that. So the real next step is to get rid of that bit of madness and have the backend keep track of where all the units are instead.

In the meantime, I have merged graphics-cleanup back into master, because it's working pretty reasonably (modulo the above).