Jump to content

Atlas after Compiling?


Recommended Posts

After compiling (with VS2010 + replacing with a newer boost-Version) I see the "binaries\system\pyrogenesis_dbg.exe"-file.

No compiling errors. I can run it and play.

But the Szenario-Editor is not available in the mainmenu. When I start the file with the "-editor"-Parameter a messagebox

appears with the following message: "The Atlas UI was not successfully loaded and therefore cannot be started as requested.

Location: Atlas.cpp:46 (ATLAS_Run)". Whats wrong?

Link to comment
Share on other sites

Atlas isn't compiled by default on Windows, since the wxWidgets dependency is a bit of a pain. See libraries/wxwidgets/README.txt and download and compile wx, then run "update-workspaces.bat --atlas" and build.

(If you just want to run the editor and not necessarily compile it, you can either use the precompiled pyrogenesis.exe in SVN (which uses AtlasUI.dll), or manually copy AtlasUI.dll to AtlasUI_dbg.dll so self-compiled Debug builds will find it, or wait for #456 (hopefully I'll have time to check it later today).)

Link to comment
Share on other sites

Do you mean something like resetting the camera to its initial position, or changing it to an orthographic non-perspective camera? Neither is supported at the moment, though I guess they wouldn't be too hard to add. (source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp implements the interface between Atlas and the camera, and it could have more functions to provide more camera control. Orthographic views would probably need changes to CCamera to compute non-perspective matrices.)

Link to comment
Share on other sites

I think that's the case - it probably needs to implement a matrix like shown here (near the bottom). It's possible GetCameraPlanePoints needs to be updated too (it depends on FOV, which is meaningless with an orthographic camera). I'm afraid I don't know enough about graphics to know if this will really work, though.

Link to comment
Share on other sites

Hey Ykkrosh,

I have tried to set the following code in CCamera::SetProjection.

(I'm calculating the l,r,b,t values from the ViewPort-width/height)


float w = m_ViewPort.m_Width;
float h = m_ViewPort.m_Height;
float r = w/2;
float l = -r;
float b = h/2;
float t = -b;
float n = nearp;
float f = farp;

// orthographic matrix
m_ProjMat._11 = 1/r;
m_ProjMat._22 = 1/t;
m_ProjMat._33 = -2/(f-n);
m_ProjMat._34 = -((f+n)/(f-n));
m_ProjMat._44 = 1.0f;

and in CCamera::GetCameraPlanePoints

	float w = m_ViewPort.m_Width;
float h = m_ViewPort.m_Height;
float x = w/2;
float y = h/2;

but this doesn't work. I can't see the terrain. Any ideas whats wrong?

Is someone else in your team, who can help me with this? It drives me crazy :)

Link to comment
Share on other sites

It looks like the camera's basically just pointing the wrong way. Also w and h are going to be measured in world-units (quarters of a tile), not pixels, so they ought to be smaller. Also need to call m_ProjMat.SetZero. This seems to work for me:

	float w = 64;
float h = 64;
float r = w/2;
float b = h/2;
float n = nearp;
float f = farp;

// orthographic matrix
m_ProjMat.SetZero();
m_ProjMat._11 = 1/r;
m_ProjMat._22 = 1/b;
m_ProjMat._33 = 2/(f-n);
m_ProjMat._34 = -((f+n)/(f-n));
m_ProjMat._44 = 1.0f;

Link to comment
Share on other sites

It'll need changes to the camera controls before it'd work properly - keep the height constant and adjust the view size when zooming (instead of moving the camera's position), and then I think it might be okay. If someone implements the controls and the mode switching, I wouldn't object to adding it into the game in some form :)

Link to comment
Share on other sites

It'll need changes to the camera controls before it'd work properly - keep the height constant and adjust the view size when zooming (instead of moving the camera's position), and then I think it might be okay. If someone implements the controls and the mode switching, I wouldn't object to adding it into the game in some form :)

The camera controls are not the only problem. Its impossible the modify/flatten/paint the terrain in the orthographic view at the moment. I don't know why, but the cursor "sticks" on some tiles and I cannot really move it. Same thing for moving objects. Too many lines of sourcecode for me to figure out what I have to change to make it work. Any ideas?

Link to comment
Share on other sites

That probably comes from AtlasMessage::Position::GetWorldSpace calling CCamera::GetWorldCoordinates calling CCamera::BuildCameraRay. That tries to compute the 3D line that's underneath the mouse cursor, and it assumes the line is always starting at the camera's location and its direction is spreading outwards to hit a point on the far plane. With the orthographic camera, that's not right - it needs to compute a line which is always parallel to the camera direction, with the origin moved depending on the target point. I don't know exactly what maths is needed, but I think that's where the problem is.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...