Author Topic: DogfightState development  (Read 46713 times)

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #45 on: October 19, 2012, 09:44:08 pm »
Believe it or not, but I've been playing the original for the past few days just to have a saved game to work with ;-). I've made some progress with multi-interceptions but there's still some things to fix. As soon as it will be playable and bug free I'll send a PR.

Offline sklll

  • Sergeant
  • **
  • Posts: 21
    • View Profile
Re: DogfightState development
« Reply #46 on: October 20, 2012, 12:05:46 am »
Can't wait for minimization to be implemented  :'(

I can play DOS version, to provide save with 5 aircrafts chasing an ufo (or maybe another situation). If this still can help - just let me know  ;)

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #47 on: October 24, 2012, 01:56:08 pm »
Okay. The beta version of multi-interceptions is implemented. I've sent a PR but it will be merged after release of v0.4.5. As soon as it is, please test this new feature. It's probably buggy because a lot of things had to be added/re-written/changed. I've done a couple of tests and it seems to work but you know how it goes. If you are really eager to test it now, you can pull the source from here and compile it yourself. I've merged the current build into mine so everything should be the same (except for dogfights of course).

Awaiting feedback.

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #48 on: October 24, 2012, 02:20:42 pm »
I've pulled your changes into my repo, will hopefully have a play with it tonight  :)

Edit: SupSuper - I sent you a PM - This now shows in my PR as well as d2uriel's. I'll try and fix it when I get home
« Last Edit: October 24, 2012, 02:50:02 pm by pmprog »

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #49 on: October 24, 2012, 03:09:56 pm »
One more thing that came into my mind a while ago which I always forget to ask.

In DogfightState class there's a lot of surfaces being instantiated with the new operator but they are not deleted within the destructor (only the timers are deleted there). Since I'm not really experienced with SDL - is this being taken care of by SDL itself or was it forgotten straight from the beginning and needs to be fixed?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2161
    • View Profile
Re: DogfightState development
« Reply #50 on: October 24, 2012, 06:47:41 pm »
One more thing that came into my mind a while ago which I always forget to ask.

In DogfightState class there's a lot of surfaces being instantiated with the new operator but they are not deleted within the destructor (only the timers are deleted there). Since I'm not really experienced with SDL - is this being taken care of by SDL itself or was it forgotten straight from the beginning and needs to be fixed?
Any surfaces that are rendered on-screen by the State (through the add() function) are automatically cleaned up by the base State destructor. The idea is that once you connect a Surface to a State, the State takes over so you don't have to worry about it (I'm hoping to expand this to timers and such too eventually). This is all part of the OpenXcom engine. ;)

However if you crate any surfaces with new that are not added to the State (eg. temp surfaces), you'll have to clean those up yourself.

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #51 on: October 24, 2012, 06:51:04 pm »
Alright, good to know that. I didn't really want to dig into the code too much cause this could as well be hidden somewhere in the SDL libs ;-). I really thought it's gonna be faster to ask this question. Hope you don't mind ;-).

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2161
    • View Profile
Re: DogfightState development
« Reply #52 on: October 24, 2012, 06:55:18 pm »
Alright, good to know that. I didn't really want to dig into the code too much cause this could as well be hidden somewhere in the SDL libs ;-). I really thought it's gonna be faster to ask this question. Hope you don't mind ;-).
That's fine, I imagine OpenXcom engine is quite the mystery for most people and they just roll with. ;) I might eventually give an overview of the inner engine functionality for the more curious programmers.

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #53 on: October 24, 2012, 08:20:07 pm »
Some notes:

  • If you launch both interceptors at the same time, only one combat box pops up - but at the top, as if waiting to draw the other screen
  • Minimising that box shows "1", but time does not resume (presuming because of the 2nd interception)
  • Restoring window "1" and selecting "Disengage" shows the 2nd interceptor box
  • Select the 1st interceptor, and set him to re-engage, once it gets back to the fight, time stops, but no interception windows show
  • Restoring window "2" removes the box, but you see no interception windows at all
    • You can however, click the geoscape (time still not moving), and however, interceptors don't respond to "Return to base"

    Also
    • Select an interceptor to attack a UFO
    • Miminise, then restore the window and disengage
    • Set the interceptor to reengage and minimise
    • Craft is now showing as "2" despite being the only craft in combat


Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #54 on: October 24, 2012, 08:57:00 pm »
Umm, how are you able to launch two interceptors at the same time?

Also
  • Select an interceptor to attack a UFO
  • Miminise, then restore the window and disengage
  • Set the interceptor to reengage and minimise
  • Craft is now showing as "2" despite being the only craft in combat
Okay, that should be fixed now. Pushed to my repo.
« Last Edit: October 24, 2012, 09:19:21 pm by d2uriel »

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #55 on: October 24, 2012, 09:32:11 pm »
When I UFO appears, you click "Intercept" in geoscape, select the first interceptor, click on the UFO, then click Intercept again, pick the 2nd interceptor and click the same UFO :)

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #56 on: October 24, 2012, 09:36:32 pm »
Right after targeting the UFO for the first interceptor, the Intercept window disappears. Umm... maybe my sources aren't that up to date at all. Lemme check that.

Edit: Well, it says my sources are already up to date when I'm trying to pull from SupSuper/OpenXcom... hmmmm....

Edit2: Till I figure out what's wrong... test it with sending interceptors within a short interval of time of each other ;-).

Edit3: I found a simple way of dealing with this issue. Committed and pushed to my repo.

Edit4: I read your post carefully again. You're not sending them at the exact same time. Unless you're that fast and the time is not able to advance between you targeting the UFO for the first interceptor and clicking Intercept again ;-).

Edit5: I closed my PR. Please comment within my repo only now.
« Last Edit: October 24, 2012, 10:41:52 pm by d2uriel »

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #57 on: October 25, 2012, 10:07:13 pm »
Still having problems, thought it'd be easier to record what I'm doing...

https://youtu.be/IRYHufVLsPE
https://youtu.be/asjyNwlzjcE

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #58 on: October 25, 2012, 10:47:15 pm »
This is weird. Are you using the latest sources of mine? Does it happen every time you do it?

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #59 on: October 25, 2012, 11:15:22 pm »
I did a pull request about 10 minutes before that post, and yes. I take it that it doesn't happen to you then?