Author Topic: [fixed] G3D Viewer issues  (Read 1869 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
[fixed] G3D Viewer issues
« on: 17 April 2012, 05:37:52 »
I didn't put this on the bug reports subforum as I'm uncertain if it's a bug or something wrong with the compiled windows version of the G3D viewer, my setup, etc. If it is a bug, feel free to move it to the bug reports subforum.

I've been having difficulty getting the G3D viewer to display a particle effect XML. While I can display any model fine, the unit particle systems have been giving me strange issues, and I've been unable to figure out a reason why. I'm using the G3D viewer that came bundled with the windows installer for 3.6.0.3, which is G3D Viewer 1.3.6. I can load the unit particle effects from the MegaPack fine (the specific file I tested was the bigtent's smoke_particles.xml), but for whatever reason, copying the file (and the particle bitmap, inside the same folder; fixing the relative link in the XML) to a working directory suddenly made it stop working. Even closing and reopening the program has no effect. When I copied this modified file back to its original directory (along with the particle bitmap file), the G3D viewer properly displayed it. Copying back into the original directory still had no effect.

The directory path has no foreign characters, and there are no spaces (though there are even spaces in the MegaPack path). The files were identical, and I've triple (quadruple, whatever) checked the relative link, and tried a number of alternative folder structures, including placing the bitmap image in a folder titled "images", adding "../" and "./" in front of the path to the particle image, yet, still nothing. The G3D viewer returns no errors, and the command line, even with verbose turned on, doesn't change at all when opening the file, although the window title changes to the name of the XML file.

The bitmap file is an exact copy of the one from the Indian's bigtent unit, and I even tried resaving it at different bit rates and tried converting it to PNG. The particle XML was a modified copy of bigtent's smoke, with just the filepath for the particle image modified, and even an unmodified version (with the particle image being moved into an "images" folder) had no avail. Even a more heavily modified version (cleaning up the bad XML formatting, removing an unnecessary comment, etc) didn't work in either location, even though the content of the XML wasn't modified, and the XML was valid (none of my attempts threw any error messages, nor anything in the command line).

I don't know if it's of any use, but here's the contents of --verbose (noting that all the output is written when the program is launched, not when loading the file):
Code: [Select]
C:\Program Files (x86)\MegaGlest>megaglest_g3dviewer --verbose
In [..\..\source\shared_lib\sources\util\util.cpp::Shared::Util::SystemFlags::ge
tSystemSettingType Line: 213]
In [..\..\source\shared_lib\sources\util\util.cpp::Shared::Util::SystemFlags::in
it Line: 233]
In [..\..\source\shared_lib\sources\util\util.cpp::Shared::Util::SystemFlags::in
it Line: 255]
In [..\..\source\shared_lib\sources\platform\common\simple_threads.cpp::Shared::
PlatformCommon::LogFileThread::execute Line: 466]
In [..\..\source\shared_lib\sources\util\util.cpp::Shared::Util::SystemFlags::in
it Line: 264]
In [..\..\source\shared_lib\sources\platform\common\simple_threads.cpp::Shared::
PlatformCommon::LogFileThread::execute Line: 474]
-=-=-=-=-=-=-= looking for file in possible location  [C:\Program Files (x86)\Me
gaGlest\]
-=-=-=-=-=-=-= looking for windows specific file in possible location  [C:\Progr
am Files (x86)\MegaGlest\windows_glest.ini]
-=-=-=-=-=-=-= About to load fileName.first = [C:\Program Files (x86)\MegaGlest\
glest.ini]
Property key [DataPath] now has value [C:\Program Files (x86)\MegaGlest\\]
Property key [LogPath] now has value [C:\Users\Mike\AppData\Roaming\megaglest\]
Property key [UserData_Root] now has value [C:\Users\Mike\AppData\Roaming\megagl
est\]
-=-=-=-=-=-=-= About to load fileName.second = [C:\Users\Mike\AppData\Roaming\me
gaglest\glestuser.ini]
OpenGL Extension [GL_EXT_framebuffer_object] supported status = 1
In [main.cpp::Shared::G3dViewer::MainWindow::loadProjectileParticle Line: 1331]
about to load [] particleProjectilePathList.size() = 0
In [main.cpp::Shared::G3dViewer::MainWindow::loadProjectileParticle Line: 1445]
after load []
In [main.cpp::Shared::G3dViewer::MainWindow::loadSplashParticle Line: 1449] abou
t to load [] particleSplashPathList.size() = 0
In [main.cpp::Shared::G3dViewer::MainWindow::loadSplashParticle Line: 1552] afte
r load [] particleSplashPathList.size() = 0
OpenGL Extension [GL_EXT_texture_filter_anisotropic] supported status = 1

The particle XML I was using is this:
Code: [Select]
<?xml version="1.0" standalone="yes"?>
<unit-particle-system>
       <texture value="true" path="images/particle.bmp" luminance="true"/>
   <mode value="black"/>
   <primitive value="quad"/>
   <offset x="0" y="-1.2" z="0"/>
   <direction x="0.3" y="1" z="0"/>
   <color red="0.1" green="0.1" blue="0.1" alpha="0.33" />
   <color-no-energy red="0.0" green="0.0" blue="0.0" alpha="0.0" />
       <radius value="0.9" />
       <size value="1" />
       <size-no-energy value="0.7" />
       <speed value="2.0" />
   <gravity value="0.001"/>
       <emission-rate value="3" />
       <energy-max value="200" />
       <energy-var value="0" />
   <relative value="true" />
   <relativeDirection value="false" />
       <fixed value="false" />
       <teamcolorNoEnergy value="false" />
       <teamcolorEnergy value="false" />

   <!--trajectory type="spiral">
      <speed value="14.0"/>
      <scale value="1"/>
      <frequency value="0.5"/>
   </trajectory-->
</unit-particle-system>

Even if I change the particle effect from a quad with an image to a line particle effect, nothing is displayed, but moving this exact file to C:\Program Files (x86)\MegaGlest\techs\megapack\factions\indian\units\bigtent, the particle works fine.
Code: [Select]
<?xml version="1.0" standalone="yes"?>
<unit-particle-system>
    <texture value="false" />
    <primitive value="line" />
    <offset x="0" y="-1.2" z="0" />
    <direction x="0.3" y="1" z="0" />
    <color red="0.1" green="0.1" blue="0.1" alpha="0.33" />
    <color-no-energy red="0.0" green="0.0" blue="0.0" alpha="0.0" />
    <radius value="0.9" />
    <size value="1" />
    <size-no-energy value="0.7" />
    <speed value="2.0" />
    <gravity value="0.001" />
    <emission-rate value="3" />
    <energy-max value="200" />
    <energy-var value="0" />
    <relative value="true" />
    <relativeDirection value="false" />
    <fixed value="false" />
    <teamcolorNoEnergy value="false" />
    <teamcolorEnergy value="false" />
</unit-particle-system>

Too long; didn't read: For whatever reason, having the particle XML in my documents folder is stopping the G3D viewer from displaying any unit particle effect, without any error messages, even if the particle effect is an exact copy from a MegaPack unit, which the G3D viewer does display properly.

I'd really like to see whatever the underlying issue is here fixed, as this is preventing me from doing some necessary work with particles (it would be far, far too difficult to reload the game every time to position particles on a unit). I don't see any reason why my system configuration would make a difference in this case, but for the record, it's a 64-bit Windows 7 operating system with service pack 1, with a Core 2 duo CPU T6600 running at 2.2GHz, an ATI Mobility Radeon HD 4650 graphics card running a 1600x900 resolution, 4 GB of DDR3 RAM, and a 500 GB 7200 RPM 3Gb/s HDD with 266 GB free, the computer is fully up-to-date, and it's the latest stable released version of MegaGlest.

Also should be noted that I have loaded particle effects into the G3D viewer in the past, without this problem (though that was quite a while ago, admittedly, there may have been several changes since then).
« Last Edit: 12 May 2012, 12:41:17 by tomreyn »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: G3D Viewer issues
« Reply #1 on: 11 May 2012, 05:19:29 »
Sorry i must have missed this. Please zip up the folder contents, upload it somewhere and I will try it out and debug the problem.

Thanks

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3D Viewer issues
« Reply #2 on: 11 May 2012, 05:42:07 »
Sorry i must have missed this. Please zip up the folder contents, upload it somewhere and I will try it out and debug the problem.

Thanks
http://www.mediafire.com/?deoqk7uemzofxuv
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: G3D Viewer issues
« Reply #3 on: 11 May 2012, 05:54:14 »
Sorry I meant the actual data files, not the viewer :)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3D Viewer issues
« Reply #4 on: 11 May 2012, 14:32:21 »
Sorry I meant the actual data files, not the viewer :)
Oops. Here's the files, noting again that these are unmodified "bigtent" smoke particles, and only seem to fail outside of the MegaGlest folders: http://www.mediafire.com/?8u1c2p2q189lb2a

On an unrelated note, when encountering an error in MegaGlest, the error boxes cannot be dismissed. Clicking "okay" just opens another box:
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: G3D Viewer issues
« Reply #5 on: 11 May 2012, 16:07:02 »
Looks like particles were meant to be displayed with a unit (thats why it works in the mg folder). If you had a proper folder structure which contained a unit XML which had the size and height of the unit it would have worked. That said i committed a bugfix in svn so this is not required to show such particles in the viewer.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: G3D Viewer issues
« Reply #6 on: 12 May 2012, 03:33:54 »
Looks like particles were meant to be displayed with a unit (thats why it works in the mg folder). If you had a proper folder structure which contained a unit XML which had the size and height of the unit it would have worked. That said i committed a bugfix in svn so this is not required to show such particles in the viewer.
Ah, I can confirm that was indeed the issue. Thanks.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert