Author Topic: GAE Pathfinder in MG ( all problems solved? )  (Read 5844 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
GAE Pathfinder in MG ( all problems solved? )
« on: 9 August 2010, 11:31:21 »
Thanks to silnarm the GAE pathfinder is introduced in the latest svn version of MG too.
First versions I saw had some problems with multiplayer and bug which made some units get stuck in the game.
But silnarm worked on it again and maybe now it works, so please test it.

We already tested it yesterday and still had problems with crossplatform gaming. We twice got an error on the only windows client in our game telling us "out of sync" :( .
But maybe claymore didn't do a full rebuild and its caused by this, so please test!

One thing we I found a bit annoying with the new pathfinder is the new feature which lets the workers not only build a building from the top left.
The feature in general is good, but there it easily hides workers in cases like these:
play indian, select a worker and tell the worker to build a tent on his current position. The worker will instantly start to build the tent from inside the tent. If the tent is done the worker is still in the tent and the player cannot see him anymore. I think the build from inside works because the tent has a cellmap which is used. Anyone has an idea how this can be solved?
Ideas are:
- Don't use the cellmap while beeing build
- if building/repairing  is done, tell all involved workers to walk outside the building somehow.

  
« Last Edit: 10 August 2010, 07:29:06 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #1 on: 9 August 2010, 16:30:03 »
I can see how that worker thing could be a problem, maybe make the worker should have to walk to any side or corner.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #2 on: 9 August 2010, 18:40:27 »
No, I think out of synch still isn't fixed yet...Silnarm says he knows what is the problem, not sure for the solution though...
Quote
One thing we I found a bit annoying with the new pathfinder is the new feature which lets the workers not only build a building from the top left.
The feature in general is good, but there it easily hides workers in cases like these:
play indian, select a worker and tell the worker to build a tent on his current position. The worker will instantly start to build the tent from inside the tent. If the tent is done the worker is still in the tent and the player cannot see him anymore. I think the build from inside works because the tent has a cellmap which is used. Anyone has an idea how this can be solved?
It is annoying when it hides it, but also very useful now, before sometimes you just couldn't build certain buildings at someplaces...

Anyways titi I'll test it later today, I first need people though.  ;) (cross comp of course...)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #3 on: 10 August 2010, 00:21:35 »
One thing we I found a bit annoying with the new pathfinder is the new feature which lets the workers not only build a building from the top left.
The feature in general is good, but there it easily hides workers in cases like these:
play indian, select a worker and tell the worker to build a tent on his current position. The worker will instantly start to build the tent from inside the tent. If the tent is done the worker is still in the tent and the player cannot see him anymore. I think the build from inside works because the tent has a cellmap which is used. Anyone has an idea how this can be solved?
Ideas are:
- Don't use the cellmap while beeing build
- if building/repairing  is done, tell all involved workers to walk outside the building somehow.
So are you saying that there's a walkable cell in the middle of the building, with no walkable cells surrounding it?  Like this:

111
101
111

and the worker is occupying the 0?

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #4 on: 10 August 2010, 00:36:04 »
So are you saying that there's a walkable cell in the middle of the building, with no walkable cells surrounding it?  Like this:

111
101
111

and the worker is occupying the 0?
Well, I think sometimes...at least.

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #5 on: 10 August 2010, 01:41:51 »
If that's the case, then it's a design flaw with the cell map, not a problem with the pathfinder.  Putting a walkable tile in an unaccessible spot is just asking for trouble.  It's like one of those games where you can fall into a pit (surviving, of course) and have no way to get out.

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #6 on: 10 August 2010, 03:08:41 »
If that's the case, then it's a design flaw with the cell map
I see.
Quote
, not a problem with the pathfinder.
Yeah, of course. I think we were just talking about the problem with this change, not the pathfinder...oh though it is related, since, in the MG pathfinder it is still that the worker/mage has to build from the top left.
Quote
Putting a walkable tile in an unaccessible spot is just asking for trouble.  It's like one of those games where you can fall into a pit (surviving, of course) and have no way to get out.
Yeah, cept, usually this time in glest you can get out.  :O Most of the time...I don't think the worker is ever "locked"...maybe just trapped... if so.

Anyways, for the solution...hmm...

Yes, it still gets out of synch. (cross comp)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #7 on: 10 August 2010, 07:26:08 »
no what I talked about is this:

111
101
101

the worker is only hidden, he can walk outside so its not a huge problems just something not so nice.
But the hidden state is simply not so good and happens very often with the new pathfinder. Humans have problems with things they don't see ;-)
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #8 on: 10 August 2010, 09:02:47 »
We already tested it yesterday and still had problems with crossplatform gaming. We twice got an error on the only windows client in our game telling us "out of sync" :( .

Damn! I thought I had it ...  :'(

Quote
One thing we I found a bit annoying with the new pathfinder is the new feature which lets the workers not only build a building from the top left.
The feature in general is good, but there it easily hides workers in cases like these:
play indian, select a worker and tell the worker to build a tent on his current position. The worker will instantly start to build the tent from inside the tent. If the tent is done the worker is still in the tent and the player cannot see him anymore. I think the build from inside works because the tent has a cellmap which is used. Anyone has an idea how this can be solved
Ideas are:
- Don't use the cellmap while beeing build
- if building/repairing  is done, tell all involved workers to walk outside the building somehow.

Option 1 I think could cause some other problems, option 2 should be Ok, and could be accomplished using the same mechanism that gets them in place (a 'goal' map tells them where they can build from, so we just re-use the goal map 'in reverse' to get them clear of the building site once finished).  I'll think on this some more though...
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved )?
« Reply #9 on: 10 August 2010, 15:14:44 »
no what I talked about is this:

111
101
101

the worker is only hidden, he can walk outside so its not a huge problems just something not so nice.
But the hidden state is simply not so good and happens very often with the new pathfinder. Humans have problems with things they don't see ;-)
Ah, okay, that's better.  You had me worried for a moment. ;D I was thinking "wait, he knows better than that!"  But yeah, now I see your problem.  I remember there was a thread a long time ago on the GAE board about highlighting hidden units, where it would just show a team-colored silhouette when the unit was obscured behind terrain or a building.  Maybe that would be useful?

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #10 on: 10 August 2010, 18:03:17 »
Yeah sorry titi, I thought it was...in the middle I guess.
Damn! I thought I had it ...  :'(
Well, we tried a test yesterday. For some reason it takes it longer to get out of synch, so it took more then 5 minutes. Heh, we got confused... But at least it seems to be better... and you do know the actual problem, I think.  :thumbup:

olaus

  • Guest
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #11 on: 10 February 2011, 21:17:47 »
We already tested it yesterday and still had problems with crossplatform gaming. We twice got an error on the only windows client in our game telling us "out of sync" :( .

i guess i just stumbled upon the reason for it: x*y != x*y for cross-platform floats:

http://gafferongames.com/networking-for-game-programmers/floating-point-determinism/


softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #12 on: 10 February 2011, 23:03:35 »
wrong, MG uses streflop which is designed to help with this.

olaus

  • Guest
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #13 on: 11 February 2011, 14:52:42 »
wrong, MG uses streflop which is designed to help with this.

but if i understand it right you can't use it with -O3 and athlon_xp:

Beware of too aggressive optimization options! In particular, since this code relies on reinterpret_cast and unions, the compiler must not assume strict aliasing. For g++ optimization levels 2 and 3, this assumption is unfortunately the default. Similarly, the compiler should not assume that NaN can be ignored, or that the FPU has a constant rounding mode. Ex: -O3 -fno-strict-aliasing -frounding-math -fsignaling-nans.

You should also set correct FPU options, like -mfpmath=sse -msse -msse2. The -msse2 is important, there are cases where g++ refuses to use SSE (and silently falls back to x87) when using -msse and not -msse2. This also means you cannot reliably use this library with gcc on systems where only sse (but not sse2) is present, like some athlon-xp cores.

from http://nicolas.brodu.numerimoire.net/en/programmation/streflop/index.html

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #14 on: 11 February 2011, 14:55:50 »
so better don't use normal Athlons any more  8)
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

olaus

  • Guest
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #15 on: 11 February 2011, 16:26:06 »
so better don't use normal Athlons any more  8)

or use a different lib for the pathfinder like http://gmplib.org/ (no FPU = slow) or http://www.trenki.net/content/view/17/37/

anyway we should first test if we're barking at the right tree by dropping -O3

using gmplib altogether is probably not good for performance because the graphics right now also use streflop, at least there's

Code: [Select]
using namespace Shared::Graphics;
... in ai.cpp.

olaus

  • Guest
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #16 on: 11 February 2011, 17:49:49 »
wrong, MG uses streflop which is designed to help with this.

not in the 3.4.0 linux-version from sf:

# strings glest.bin |grep -i streflo
%s, STREFLOP NOT enabled.

in windows on sf it's enabled.


softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #17 on: 11 February 2011, 19:21:34 »
This was in fact a mistake when we switched to cmake, the compiler define was missed for Linux somehow. Its fixed in svn for now, but we need to investigate if its really needed since we have played (And 3.4) is compiled for Linux without it.

olaus

  • Guest
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #18 on: 11 February 2011, 21:03:35 »
This was in fact a mistake when we switched to cmake, the compiler define was missed for Linux somehow. Its fixed in svn for now, but we need to investigate if its really needed since we have played (And 3.4) is compiled for Linux without it.

well, the change to cmake was in june, the pathfinder-fail was in august, so that would fit.

yesterday there was an out of sync error:

#glest.txt:T 1297294080 2<tomreyn2>   [2011-02-10 00:25:37] *ERROR* In [/home/softcoder/Code/megaglest/trunk/source/glest_game/game/game.cpp::update Line: 831] Error [Error [#3]: Game is out of sync, please check log files for details.]

and in only have a tiny chat-log because i'm rarely on irc, someone with a complete one might grep it for "sync" of there were more problems.

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #19 on: 11 February 2011, 22:42:55 »
This was a different issue which is now fixed since a post 3.4.0 subversion revision.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

olaus

  • Guest
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #20 on: 11 February 2011, 23:56:32 »
ultifd and me just tried SVN with RP-beta & STREFLOP (linux&win), still got out of sync after some minutes.

message: can not find command type for unitid: 200031
« Last Edit: 11 February 2011, 23:59:49 by olaus »

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #21 on: 12 February 2011, 00:35:24 »
If people are willing to run this experiment again, please set the following in the ini,
Code: [Select]
DebugLogFile=debug.log
DebugMode=true
DebugPerformance=false
DebugNetwork=false
DebugWorldSynch=false
DebugPathFinder=true
DebugLogFilePathFinder=pathfinder.log

I'd be interested in perusing a pair of pathfinder.log files from either end (JUST the pathfinder.log).
Glest Advanced Engine - Code Monkey

Timeline | Downloads

olaus

  • Guest
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #22 on: 12 February 2011, 07:23:16 »
forgot to say that we were still using -O3, next experiment should be -O0

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #23 on: 13 February 2011, 23:14:54 »
? this was all discussed a long time ago, result: it works with -O3! At least on all the least linux versions! and in windows we optimize too.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: GAE Pathfinder in MG ( all problems solved? )
« Reply #24 on: 14 February 2011, 00:44:32 »
OK back to topic:
Tomreyn and I played multiplayer today using the GAE pathfinder.
1. we did not get out of sync and it was a long game! I used linux32 and he linux64 bit

but we both saw routeplanner problems, here are mine:
- my units sometimes(rarely) walked not the direct way, although there was place on the map. ( not 100% shure here, but we both saw such things )
- my units got stucked while attacking and was not willing to move for a while ( when giving them other attack orders and just for some seconds  )
- my units were trying to reach a place that was blocked by other units and did not abort their walk command ( and did not attack by this )
« Last Edit: 14 February 2011, 00:57:09 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios