Author Topic: My DB2 non-optional changes, what do people think?  (Read 10944 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #15 on: December 01, 2010, 07:53:18 PM »
Quote
The aspect ratio is a display bug only; it shouldn't affect the simulation at all.

It will not affect a simulation.

It will affect "the" simulation when you start a new one...

What?

Are you talking about the simulation size or the aspect ratio of the graphics?

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #16 on: December 02, 2010, 03:20:47 PM »
Numsgil, here, look:



Uploaded with ImageShack.us

If I press "Start new" the resulting simulation the way it is setup above will always be a square…

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #17 on: December 02, 2010, 03:29:58 PM »
The display and the underlying simulation are separate.

For instance, I assume you know you can zoom in and out with the magnifying glass icons?  That only works if the display is separate from the simulation.

Try spamming the zoom in, zoom out, and lock/unlock icons.  When you see a tiny white square in the top left corner that's a good indication that the display is borked (that white square is the simulation extents.  You're waaaayyy zoomed out).

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #18 on: December 02, 2010, 03:46:22 PM »
Tryed it. Same thing.

One good way of knowing is, If you do what I did above and insert like 5 blank robots, look how they position themselfs.



Uploaded with ImageShack.us

And if I started this one wide then the result will be wide...



Uploaded with ImageShack.us

All I am doing is clicking the species tab first, and then start new...


BTW: With my planB I am not sure if I can resize a MDIForm to be bigger then the desktop...
« Last Edit: December 02, 2010, 04:07:27 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #19 on: December 02, 2010, 04:20:24 PM »
Bleh, you're not understanding.

Okay, imagine there's a square simulation, with the simulation extents of like 2000x2000.

Now imagine you draw it.  If the aspect ratio is wrong, it will be drawn as a rectangle.  The underlying simulation is still 2000x2000.  The bots see it as 2000x2000.  But you, a human, see it as rectangle.  Because of the way graphics are drawn, circles will still look circular, but they won't match up to the physical reality of the actual simulation (which from your point of view would be ellipses).

There's some code somewhere that can sort of reset the aspect ratio, but it's buried right now in the lock/unlock or zoom in/out code, and it's conditional on the state you came from and the state your going to (eg: try zooming out from a "locked" display that's zoomed way out).  Which is why it should fix itself if you can spam those buttons in specific order I don't remember.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #20 on: December 02, 2010, 04:33:59 PM »
I think we should simplify the heck out of this one.

We need to have fixed ratio for our simulation and it should draw in that ratio... If anything add a scroll bar or zoom out...

ex:

If the simulation is a rectangle and the mdiform is a square it should display border limits on the top and the buttom, or a scroll bar across the buttom.

Now that I realise how crazy complicated this "aspect ratio correction" code is, I am not touching it, so I will do my PLAN A fix until someone can sit down and really fix it.  :wacko: However, I might look into adding vertical zoom in, zoom out buttons. And horizontal zoom in , zoom out buttons. I will also look into resetting the paint area to fit with the mdiform if the mdiform gets bigger.
« Last Edit: December 02, 2010, 04:57:45 PM by Botsareus »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #21 on: December 02, 2010, 06:54:39 PM »
Numsgil, I just tried to separate the zoom algorithm into X and Y zoom algorithms without any luck. You are right, the system "stretches" the simulation to fit it into the screen ratio. As of now I am leaving this code alone.
Sorry for the misunderstanding. This concept was confusing for me, imagine how confusing it will be for a new user, I suggest you add a wiki on this subject to make sure new users are not confused.
« Last Edit: December 02, 2010, 07:30:20 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: My DB2 non-optional changes, what do people think?
« Reply #22 on: December 02, 2010, 07:20:18 PM »
Sorry for the misunderstanding. This concept was confusing for me, imagine how confusing it will be for a new user, I subject you add a wiki on this subject to make sure new users are not confused.

It's only confusing when it's not working right (or you're looking at the code, haha).

Intuitively we have a good understanding of how it should work: it's like a video microscope.  You can move around (translate) and zoom in and out, and independently of that you can also enlarge the screen size and move the window around on your desktop.

The problem is that coding it to do that correctly requires handling a lot of Windows events and working through the math.  I've got it working fine for DB3 with the various Viewport and Camera classes, so if someone wanted to take a stab at redoing the graphics side of DB2 to do something similar it should work pretty well.