puzzlepaint / freeage

An open-source reimplementation of the game engine of Age of Empires 2: Definitive Edition.
59 stars 4 forks source link

[Discussion] Ideas about the unit type system #16

Closed MaanooAk closed 4 years ago

MaanooAk commented 4 years ago

I wanted to share some ideas, a started writing an Issue, then switched over to a Gist, and I ended up with this pr and 600 lines of pseudo incomplete c++ code, because I thing commenting on code is better that one thread of messages plus I think that the best way to describe code is with code (and some comments).

When you have some free time take a look...

Roadmap:

MaanooAk commented 4 years ago

@puzzlepaint How do you feel about this? Should I try implementing it for real or leave it for now? I think I could start a new pr where I implement only the *Stats structs and then replace the GetUnit/Building* static functions. What do you think?

puzzlepaint commented 4 years ago

I think that the system proposed here would be a good next step. It would finally replace all those hardcoded GetUnit/Building... calls, which seems nice and also makes it more worthwhile to add larger parts of the game's content (more unit / building types) since there would be no need to refactor it again soon anymore. Together with the ability to research technologies, this could thus really move the project forward from my point of view.

I think I could start a new pr where I implement only the Stats structs and then replace the GetUnit/Building static functions.

Seems like a good way to ensure that the structs provide the needed functionality.