Author Topic: Introduction of myself, Code feedback & questions  (Read 1614 times)

Offline memmaker

  • Captain
  • ***
  • Posts: 95
    • View Profile
Introduction of myself, Code feedback & questions
« on: December 16, 2019, 01:32:49 pm »
(Hope this board is the right place to post. If not, please move.)

Hi everyone, thanks for this place.

I really like the enthusiasm and spirit here. Also I really respect how much work and love has been put into this old game in order to keep it alive and enhance it.

My first UFO Defense playthrough was finished last week with OXCE as the engine. I had a blast.

So I grabbed my MacBook today (I already know that the X-Piratez Author does despise Apple and I thus cannot play his Mod on my Machine..;P) and downloaded the OXCE source repository in order to browse the code a bit.

And again I am impressed. I was able to compile and launch the project on my second try and it just works.

When reading the source I was pleasently surprised to find it neatly structured and using OOP paradigms, also the UI code looks quite modern and understandable.

Also the space-walkie-talkie and Leeroy comments had me smiling while reading more than once.

Still trying to understand some of the particularities of the code base and thought I might ask some questions here:

Is there some kind of big picture documentation for the source code? I know that the folders already tell a good story and most filenames are self-explanatory, but I wonder if there may be some conventions or concepts I should be aware of while browsing the code.

I found some state-changing code in a class called SavedBattleGame (e.g. fire/smoke spreading), so I guess this class is not just for the savegames (as I first assumed from the name) but does some grunt work for the world space?

Every meaningful state change is accomplished via an Action object instance? Is this true for all states?

I just found the class BattlescapeGame where some really interesting stuff seems to happen. For a quick test I modified the TU cost of the kneel action.

Thanks for all the great work, so that other people like me can have a look and learn and maybe even contribute ourselves.

Offline Yankes

  • Commander
  • *****
  • Posts: 3207
    • View Profile
Re: Introduction of myself, Code feedback & questions
« Reply #1 on: December 17, 2019, 08:59:43 pm »
Some logic could be spread through multiple files. Overall most of things in `Savegame` will be save/load to savefile. It have some critical logic but rest of it is placed in correct folders like `Battlescape` etc..

Actions are more user inputs, they cause lot of things but are only on "outside", more importation part is `pushState` or `popState`, here most work is done to change state of game. See example of `void AlienInventoryState::btnOkClick(Action *)`.