Author Topic: DogfightState development  (Read 53706 times)

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #60 on: October 25, 2012, 11:19:53 pm »
No, it doesn't. Can you try to fork my code to a seperate repo instead of pulling it to yours? Maybe there's a different issue here.

There are other bugs found but it does work for me pretty well.

Edit: Have a look: https://www.youtube.com/watch?v=-rI6VkDLzo8&feature=youtu.be
« Last Edit: October 25, 2012, 11:26:08 pm by d2uriel »

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #61 on: October 25, 2012, 11:47:11 pm »
I downloaded your Git, compiled it, and it did exactly the same as what it did from my repo!? I have no idea why it works different for you than me.

I'm compiling with VS2008 BTW, not that that should make any difference...

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #62 on: October 25, 2012, 11:52:38 pm »
I'm using 2010 but it shouldn't make any difference IMO. So it does happen every time you start a new game and launch two interceptions?

I know radius75 also tried it - you haven't had this kind of issues, right? You had others, though :P.

What the heck? Every time I try it - it works without any problems. Umm... weird.

Edit: can you set a breakpoint at line 385 in GeoscapeState.cpp file and run the game again in debug mode? Ooh... are you running debug or release version?
« Last Edit: October 25, 2012, 11:55:43 pm by d2uriel »

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: DogfightState development
« Reply #63 on: October 26, 2012, 12:04:07 am »
Still having problems, thought it'd be easier to record what I'm doing...

https://youtu.be/IRYHufVLsPE
https://youtu.be/asjyNwlzjcE
Confirm this, on vc2010. tested on commit [ec7e92412e13959f84287bab702b7ccc626cc45d]

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #64 on: October 26, 2012, 12:15:07 am »
Yes, does it every time

Release. The game won't start if I run the Debug mode (not figured out why).

Anyhoo... I found this little gem:

_dogfights[0]._x = 80
_dogfights[0]._y = 304

_dogfights[1]._x = 80
_dogfights[1]._y = 0

Edit:
Could this be a scaling issue?

Edit 2:
Call me n00b, but where the frigg does _y get set? there's a _y(0) suffixed on the constructor, but I don't understand where it gets set?!
« Last Edit: October 26, 2012, 12:36:07 am by pmprog »

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #65 on: October 26, 2012, 10:10:38 am »
Yes, does it every time

Release. The game won't start if I run the Debug mode (not figured out why).

Anyhoo... I found this little gem:

_dogfights[0]._x = 80
_dogfights[0]._y = 304

_dogfights[1]._x = 80
_dogfights[1]._y = 0

Edit:
Could this be a scaling issue?

Edit 2:
Call me n00b, but where the frigg does _y get set? there's a _y(0) suffixed on the constructor, but I don't understand where it gets set?!
Aah, I know what's wrong! Thanks for this piece of information. Try the newest build.

AFAIR, when I used screen resolution for calculating window positions it wasn't working. I guess we still work with 320 x 200 and then the image is up-scaled to whatever resolution you have chosen in the settings, right?

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: DogfightState development
« Reply #66 on: October 26, 2012, 10:29:09 am »
Yep, works fine now! Good job!

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #67 on: October 26, 2012, 10:31:41 am »
Not really fine, but it works ;-).

I'll update the first post with bugs that are still present. Check it please before posting a bug you find ;-).

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: DogfightState development
« Reply #68 on: October 26, 2012, 01:14:51 pm »
Does someone have save with four interceptors in Base? He necessary is to tests  :-[

Edit
OK, I already have him :)

https://www.speedshare.org/download.php?id=4086F13A1
« Last Edit: October 26, 2012, 01:24:28 pm by radius75 »

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #69 on: October 26, 2012, 01:29:07 pm »
I'm experiencing a different issue now. Creating a new DogfightState object takes about 200ms in debug mode (a little less in release). Because of that you can see a small slowdown when a dogfight is about to be started (just before the zoom in effect).

Does someone have save with four interceptors in Base? He necessary is to tests  :-[

Edit
OK, I already have him :)

https://www.speedshare.org/download.php?id=4086F13A1
Haha, good one ;-). Fixed.

Edit: Don't use that saved game for testing now though. It has the wrong values saved. Well, you can do it but you need to return all crafts to the base and make them intercept again.

Edit2: New build available. Cosmetic changes to code... which may break stuff ;-).

Edit3: Regarding the creation time issue - I'm wondering if the dogfight handling shouldn't be a bit different. Maybe I should create 4 instances of DogfightState class when the game starts and then just use them when necessary without deleting them? That would make this issue disappear. What do you think? Is the slowdown really frustrating?
« Last Edit: October 26, 2012, 02:06:15 pm by d2uriel »

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: DogfightState development
« Reply #70 on: October 26, 2012, 02:09:49 pm »
Geoscape buttons are enable if the dogfight window  is open ;)
[661cec6f3e395601...]

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #71 on: October 26, 2012, 02:28:46 pm »
Geoscape buttons are enable if the dogfight window  is open ;)
[661cec6f3e395601...]
Fixed.

The other one with changing interceptors target while it's interception window is minimized is also fixed.

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: DogfightState development
« Reply #72 on: October 26, 2012, 03:24:12 pm »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: DogfightState development
« Reply #73 on: October 26, 2012, 04:56:05 pm »
Aah, I know what's wrong! Thanks for this piece of information. Try the newest build.

AFAIR, when I used screen resolution for calculating window positions it wasn't working. I guess we still work with 320 x 200 and then the image is up-scaled to whatever resolution you have chosen in the settings, right?
Yes, internally the game is all 320x200 and scaled in post, makes it a lot easier to manage. :P The only time you need to account for the real screen resolution is when doing advanced stuff like handling the mouse cursor position.

Offline d2uriel

  • Sergeant
  • **
  • Posts: 49
    • View Profile
Re: DogfightState development
« Reply #74 on: October 26, 2012, 09:41:57 pm »
Yes, internally the game is all 320x200 and scaled in post, makes it a lot easier to manage. :P The only time you need to account for the real screen resolution is when doing advanced stuff like handling the mouse cursor position.

That explains a lot. Well, next time I'm not gonna make the same mistake again (hopefully) ;).

Anyway... how's the testing going?