Author Topic: Glest Advanced Engine  (Read 147200 times)

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
(No subject)
« Reply #125 on: 21 March 2008, 19:05:27 »
0.1.9 Is working great on my machine. The camera is a bit smoother than 0.1.8 as well.

My system specs are: Vista 32 bit / Core2Duo 1.8Ghz
« Last Edit: 1 January 1970, 00:00:00 by wciow »
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

daniel.santos

  • Guest
(No subject)
« Reply #126 on: 21 March 2008, 21:38:38 »
Quote from: "martiño"
I think it could be solved by using one of the libraries that abstract floating point calculations, or by changing all the synchronized code to fixed point, it is not a trivial task however.

No trivial task at all.  I can't even get a mutiplayer game on the same platform to stay in sync right now. :( I suspect that some of the platform compatibility problems can also be due to word alignment and I finally completed a reworking of the net layer so that word alignment should be properly translated (in the 0.2 branch).  But it's honestly not in very good shape right now, the game goes very out of sync and will only work if you turn off network consistency checks.  I haven't dug into this much yet.  On windows, it even has an access violation when trying to restore a saved network game. However, I did play a game between my linux and windows machine and won!

Off topic, the corruption path, and magic faction in general on FPM is way out of balance. I think the primary problem is my conversion of battle mage attacks from energy to fire and the impact that fire has on wood.  I'll probably scale back the total damage of all fire-based attacks on the magic side to help compensate.  Necromancers and Liches are still fairly impotent when it comes to attacking buildings and such, so that's good.

orion,
What type and speed is your processor?  And yes, I'm so you can play between windows and linux.

EDIT: I forgot to mention that it notifies you when somebody in your network game has disconnected and autosaves the network game so you can pick up where you left off.  This now works in the 0.2 branch (aside from the other errors).
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

Dr.Dixie

  • Guest
(No subject)
« Reply #127 on: 22 March 2008, 03:39:32 »
*sigh* I can't wait till I can play with all our machines. XP, Vista, Ubuntu, maybe even Sabayon. Hmm...

The Linux version of Glest seems to be generally worse than the windows one on my machine. But then, I am always running it with the pathetic integrated GPU. (my Radeon can't seem to get me a good 1280x1024)


!Dr.Dixie!
« Last Edit: 1 January 1970, 00:00:00 by Dr.Dixie »

daniel.santos

  • Guest
-
« Reply #128 on: 23 March 2008, 07:27:19 »
After some testing and debugging, I've decided to go ahead and release gae 0.2, despite some instability in network games.  I have also updated the FPM tree some and have played it a few times.  I finally found the problem with cross-platform network games and fixed it.  It turns out it was a difference in the order that the findAll global function returned the names of files -- Windows sorts file names differently than Unix/Linux.

Glest Advanced Engine v0.2 & Four Path Magitech v0.1.4
Code: [Select]
[list][li][url=http://glest.codemonger.org/files/glestadv-win32-0.2.rar]GAE v0.2 win32 binaries[/url][/li]
[li][url=http://glest.codemonger.org/files/glestadv-src-0.2.tbz2]GAE v0.2 sources[/url][/li]
[li][url=http://glest.codemonger.org/files/four_path_magitech-0.1.4.rar]FPM v0.1.4 tech tree[/url][/li]
[li][url=http://glest.codemonger.org/files/glestadv-0.2-fpm-0.1.4-win32.rar]GAE v0.2 win32 binaries w/ FPM v0.1.4 tech tree[/url][/li][/list][u]Glest Advanced Engine v0.2 Changes[/u][list]
    • Cross-platform consistiency checks have been fixed (you don't have to disable NetworkConsistencyChecks checks to play cross-platform anymore).
    • (internal change) Reworked the Config class so that it's auto-generated by a script "mkconfig.sh" from templates and a config.db file.  This way, changes can be made to configuration options in one place and don't have to be double checked in multiple locations.
    • Reworked the network layer to use htons/htonl/ntohs/ntohl functions to convert data from the native endinaness instead of transmitting data from raw C structs. This should keep network data stable across different operating systems as well as CPUs  (i.e., x86, ppc, mips, arm, etc.).
    • Implemented MaxFPS .ini setting.  This allows you to specify the maximum number of video frames to render.  This is there for those with faster machines, especially those in warmer climates, who would prefer to burn as little power as possible.  My machine will normally render between 100 and 200 frames per second if I let it.  Since the human eye can't tell the difference between 60 and 200, I keep mine set at 60 FPS, which is plenty (and my CPU sits at 35%-ish utilization).
    • You can also tweak the world update FPS with "WorldUpdateFPS", which I wouldn't recommend.  However, if you are playing across a very slow network, you can set this to 30 (down from 40) for a slight improvement at the cost of slightly choppy play.
    • Added a "very-clean" jam build target to clean up every generated file, directory and symlink from mk/linux (including saved games and such).
    • (internal change) generalized some of the platform-specific header files and moved them from shared_lib/platform/xxx into shared_lib/platform.
    • When you get disconnected from a network game, the server now automatically saves and tells you.  This still needs some work though as it behaves a little funny sometimes.
  • Merged Jaagup's patch to save your resources and explored area, but it still need some work and isn't working right now (it saves the areas you've explored, it just doesn't retrieve them right :)
    * Client will sometimes crash in mulitplayer network game.  In the one scenario I was able to catch this in a debugger, I determined that it was due to a mismatch in unit IDs on the client and server. 
    * Server sometimes crashes, so save every now and then. :) I'll have some fixes for these issues later.
« Last Edit: 13 April 2016, 20:33:41 by filux »

Dr.Dixie

  • Guest
(No subject)
« Reply #129 on: 24 March 2008, 05:48:51 »
Daniel, about pet/guarding (by right-clicking, anyway), it seems pretty useless, because the guarding unit isn't doing any good. It's ONLY goal is to be as close to the master (or in the case of your bug, whatever), meaning it is NOT guarding. I find this majorly annoying. I'd like to send a unit somewhere with a few air or ground guards to defend it from such things as dragons or archers.

I haven't gotten into Windows since 0.1.9, but I might try to, because FPM is starting to interest me. *chortle*


!Dr.Dixie!
« Last Edit: 1 January 1970, 00:00:00 by Dr.Dixie »

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
-
« Reply #130 on: 24 March 2008, 13:00:37 »
Nice work Daniel, maybe SDL_net might be worth a look to help solve the network problems.
« Last Edit: 13 April 2016, 20:34:29 by filux »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Archmage

  • Guest
(No subject)
« Reply #131 on: 24 March 2008, 17:27:56 »
I found an error with the GAE. I downloaded * GAE v0.2 win32 binaries w/ FPM v0.1.4 tech tree - and the wall model was a pig. The path of the model was in magitech/.../techs/.../pig - when I looked into the wall folder I found a .blend and a .tga files for the wall, i opened them and the model was the model for the wall. Can you upload the .gd3 file for the wall, or in the new release make the correction?

Ideas - can you make it so that you can turn the buildings ie - the wall could face any directon left right etc. ? (before building them?) When building walls the walls have to be turn able.
- Maybe a magic building called hellgate? Maybe instead of the grave yard? (turn able will help here)
-The ability for archers to go into towers, to help - the tower instead of 1 arrow at a time can have more?
« Last Edit: 1 January 1970, 00:00:00 by Archmage »

Duke

  • Guest
(No subject)
« Reply #132 on: 24 March 2008, 17:55:54 »
lol, that pig is no bug, its a joke (;
Did you notice that the graveyard is a big yellow container?

Remeber this is WIP. For the FPM that is even more so then for GAE.

I'd like to see turnable buildings too, but for walls it is not nesessary since buildings have to be square anyway you'll build them segment after segment.
It would be only relevant if the tops of these walls are walkable.

archers in towers and stuff are already planned.
« Last Edit: 1 January 1970, 00:00:00 by Duke »

Archmage

  • Guest
(No subject)
« Reply #133 on: 24 March 2008, 19:08:57 »
Thanks! Why was there a wall model in the .blend then?
« Last Edit: 1 January 1970, 00:00:00 by Archmage »

Duke

  • Guest
(No subject)
« Reply #134 on: 24 March 2008, 19:12:20 »
wciow usually does thge model, maybe daniel didn't notice it, so that would probably classivy as a bug (;

Oh and one notice when you are using glest 3.1.2 data files.
/home/patrick/glest/glest_game/data/core/menu/textures is missing and english.lng needs an update. They are in the svn.
« Last Edit: 1 January 1970, 00:00:00 by Duke »

Archmage

  • Guest
(No subject)
« Reply #135 on: 24 March 2008, 22:17:58 »
I found a bug - if you select random position in the start game options then the game will close and after that - this happened to me twice and I had to re  unzip GAE both times. And re install glest 3.1.2

Mad me mad >:(
« Last Edit: 24 March 2008, 22:28:15 by Archmage »

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
(No subject)
« Reply #136 on: 24 March 2008, 22:21:54 »
Quote from: "Archmage"
Thanks! Why was there a wall model in the .blend then?


The model for the wall is included because all models that are in progress are included as part of the FPM. This allows anyone to take a look and change/improve the models if they want to help out. ATM the wall isn't textured so Daniel has linked a pig model as a placeholder. It is possible to export and compile the .blend file if you want to see it in game.
« Last Edit: 1 January 1970, 00:00:00 by wciow »
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

daniel.santos

  • Guest
(No subject)
« Reply #137 on: 25 March 2008, 03:30:04 »
Archmage, sorry about the bug.  I didn't expect 0.2 to be really stable considering the amount of changes it had.  I believe that bug is fixed in the current revision of 0.2.1, but that is still wip.  I have solved one of the possible ways that a multiplayer game can get out of sync and I'm working on tweaking it out now so there's less bandwidth usage.  From 0.2.1 forward, the clients in a multiplayer game will behave much more like a thin client, predicting what will happen, but allowing the server to dictate important events like creation of new units, damage and the application of effects. I just need to get the network messages whittled down to their proper sizes (I'm compressing them in memory as well).  As Duke said, GAE is still a major work in progress.  I greatly appreciate all who use it and post feedback and I will try to keep the game experience as enjoyable as possible while it's going through this transition.

As far as the piggie, I'll respond to that on the FPM thread to keep this one on topic :)

As far as buildings, walls will definitely be turnable.  But I think there may need to be a more complicated mechanism to make them realistic, I just need to flush out the specs for it.  I would like for walls to look better than, for instance, Age of Empires where different wall heights just sort-of stair case, that's not good enough for me.  I like the idea of walls being walkable and I've considered this quite a bit myself myself.  In times of olde, the walls of a castle provided an enormous benefit to the defenders because:
  • The defenders did not have to move
  • They had small stone walls to hide behind with breaks in them that they could fire arrows from, or had arrow slits which were even better (had enormous cover)
  • They had the advantage of height, which meant that they could hit their targets from further away, but their attackers had to be closer to hit them.  This also caused the upper portions of the attacks, which are typically less armored, to be exposed.
This may be a topic more suited for the FPM mod discussion, but the engine will have to be modified to accommodate it.  Part of the solution to the problem of defensibility will be addressed when we implement "housing", a mechanism to allow units to be contained with in another unit and still (optionally) be allowed to attack, possibly even with an alternate attack or mechanism, such as hot oil dropped from castle walls, etc.

I would like to begin addressing these issues soon, but I want to get all of the network playability issues hammered out early so that we can maintain a steady progression of online play tests as we go through the rest of the modifications.  This also makes the topic of diplomacy a more feasible one (I can't remember who brought that up originally), like the option of being able to control each-other's units when playing on the same team, trading goods/resources/units, etc.

I'm going to have a little less time to work on this for the next few weeks, but I'll keep development going.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

ZaggyDad

  • Guest
(No subject)
« Reply #138 on: 25 March 2008, 04:01:04 »
You should make there be a range limit thingy, too (then you could do dropping mortar from walls, too.).

And btw (not that it matters), it was me who brought up diplomacy.

~Zaggy
« Last Edit: 1 January 1970, 00:00:00 by ZaggyDad »

daniel.santos

  • Guest
(No subject)
« Reply #139 on: 25 March 2008, 12:24:19 »
Sure it matters, credit where credit is due. :)

I just wanted to post an update on 0.2.1.  Unfortunately, what I'm working on right now isn't very high visibility, because it's the internals of how the client and server communicate and how the client manages it's world.  I've got the majority of the features to keep a game well in sync in place, but they still need more debugging.

The issue that we're facing here (and I presume this exists in the mainline Glest as well) is the subtle difference in timing caused by network lag.  The differences that occur between the game on the client and server is very small at first, but this gradually grows until the discrepancies get to the point of units being alive on one person's game but not existing on another's.  This is when we finally get an error message that crashes the game.

To solve this problem, I've been modifying the behavior in each section of the code where discrepancies like this occur so that the server sends an update on the units involved to the client and the client accepts those as facts and adjusts its copy of "the world" to match.  This its self introduces a lot of challenges, like what to do with unit 2 after the server told me that unit 1 should be standing in his place.  The result (at the moment) is that units tend to jump around a little (mostly when in combat), but I should have this straightened out soon so that the jumping around is minimal.  The bright side of this is that the game stays in sync.

I'll hopefully have something ready in a few days.  Another problem right now is that the networking code is in an insecure state and error handling is very poor.  These are two things I plan on addressing once I get network games actually working well.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

Dr.Dixie

  • Guest
(No subject)
« Reply #140 on: 25 March 2008, 14:53:26 »
Go Daniel!!


!Dr.Dixie!
« Last Edit: 1 January 1970, 00:00:00 by Dr.Dixie »

Duke

  • Guest
-
« Reply #141 on: 25 March 2008, 15:09:50 »
You might want to take a look here:
Code: [Select]
[url=http://www.opennel.org]http://www.opennel.org[/url]It's a very good open source MMO engine. The Networking is far more complex, but you might some very usefull hints.
« Last Edit: 13 April 2016, 20:34:53 by filux »

daniel.santos

  • Guest
(No subject)
« Reply #142 on: 25 March 2008, 17:26:01 »
Thanks Duke, it's good to know about that project. :)  Making a large number of changes creates a large number of bugs, so there's a lot to clean up and straighten out.

In some ways, I haven't modified Glest's networking architecture too greatly, this is a breakdown.
  • Util::Platform::Socket layer - This is Glest's low level socket manager (in the shared lib).  It is implemented using TCP and issues related to timouts and such are embedded in other layers, so it's not that easily transported to a UDP implementation should we want to do that at some point.  Although I don't think it would be too many changes to get it there.
  • Glest::Game::NetworkInterface - This is Glest's base class (an abstract class) for all network interfaces in the game.  Primarily, it dictates that a network interface should be able to get a Socket object and it has a transmit and receive buffer.  I have modified this to add a NetworkMessage queue and to use my NetworkDataBuffer class instead of a char array (will explain that later).
  • Glest::Game::GameNetworkInterface derives from NetworkInterface and implements more game-specific functionality, like an update(), updateKeyFrame() and functions to manage chat and command transmission and reception.  I haven't made any significant modifications to this class.
  • Next are ServerInterface and ClientInterface which I have modified quite a bit.  Some of the mods are a bit hacky still, but not too bad.  ServerInterface has a function to send a file (compressed or uncompressed) and it basically breaks it down into chunks friendly for UDP protocols and ClientInterface has a private inner class that it uses to receive and reassemble the files.  I have also added mechanisms for the server to send updates (to objects in the game) to the client and for the client to receive them, as well as a mechanism for the client to explicitly request updates for specific game objects when it knows that they are out of sync, and the server has a mechanism to respond to those requests.
  • NetworkMessage is the base class for all messages transmitted in Glest and GAE.  I have added to this library a NetworkMessageFileHeader and NetworkMessageFileFragment for transferring files, NetworkMessageXmlDoc, a base class for transmitting xml document fragments in compressed form, and then NetworkMessageUpdate and NetworkMessageUpdateRequest to handle the previously explained messages.  Each of these last two derive from NetworkMessageXmlDoc, so I can reuse most of the same code that we use for saving games as xml files.  The NetworkMessageXmlDoc class can still benefit from some tweaking by assembling a good dictionary for the zlib algorithm, that can reduce message sizes significantly, but they aren't very big right now anyway.

So an important feature of this is keeping the game logic out of the network layer.  These classes (for the most part) only facilitate the interface for the real game logic classes (Game, World, UnitUpdater, etc.) to run the game.  There is room for improvement, but it's not too shabby in it's current form.  Also, the NetworkDataBuffer class is the platform neutrality device.  The way it works is that you pass it values and it writes them to it's internal buffer using network endianness (htons, e.t., a.l.).  The buffer objects are actually owned by NetworkInterface and when you are done adding messages for that particular go around you just call NetworkInterface::flush() and  the data is transmitted -- specifically, whatever data can be transmitted without blocking the main thread is sent and the remainders are transmitted when it's update() method is called.

NetworkDataBuffer derives from a class I wrote called SimpleDataBuffer which is in essence a data queue that allows constant time insertion of data at the end of the buffer and constant time retrieval/removal of data at the beginning and almost never has to memcpy it's internal data buffer around.  Of course, it supports auto-expansion if you fill it past it's originally allocated point, but you usually won't run into that problem.  NetworkDataBuffer extends from it by adding peek(), read() and write() methods for each supported data type (basically, 8, 16 and 32 bit data types).

Throughout the network layer, runtime_error is thrown when things go wrong and I haven't exactly improved upon that yet either (I've added to the mess :(  Unit production, and building is working better than it ever has.  Morphing seems to be working flawlessly (thus far), I haven't tested combat again in a few builds (should be working well now, with minimal amounts of jumping around) and there's still an odd issue every now and again with buildings getting built but still being unfinished.

Anyway, I'll keep you guys posted.  I considered back porting some of the bug fixes to the 0.1 branch, but decided against it since we still have a small user base.  But after these changes, I'm going to try to keep some stable builds around.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

ZaggyDad

  • Guest
(No subject)
« Reply #143 on: 25 March 2008, 21:13:02 »
For some reason Glest (not only advanced(I just found that out)) started crashing every time I go into any submenu of the main menu made to start a new game (not join network game, about or options), giving this error:

Network error: Error binding socket (Code: 10048)

Edit: I rebooted my computer, and it started working, so you don't really need to research the problem, but it might be good to anyway.

~Zaggy
« Last Edit: 1 January 1970, 00:00:00 by ZaggyDad »

daniel.santos

  • Guest
(No subject)
« Reply #144 on: 26 March 2008, 23:50:25 »
Unfortunately, it "crashes" right now in windows when you have a network problem like this instead of giving you an error message in game.  In Linux, it just doesn't properly respond, but spits an error message out to the console.

As to the error binding socket, this is a typical windows issue and may have been caused by a previous instance of Glest or GAE being hung in memory and sitting on that port.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

ZaggyDad

  • Guest
(No subject)
« Reply #145 on: 27 March 2008, 00:13:29 »
It doesn't give me any error messages that I know of.

~Zaggy
« Last Edit: 1 January 1970, 00:00:00 by ZaggyDad »

daniel.santos

  • Guest
(No subject)
« Reply #146 on: 27 March 2008, 02:49:27 »
Yea, that's what I was saying.  You're using windows right?
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

ZaggyDad

  • Guest
(No subject)
« Reply #147 on: 27 March 2008, 03:47:19 »
Yup. And (sadly)my hard drive can't fit linux yet. :confused: (It's WAY too small.)

~Zaggy
« Last Edit: 1 January 1970, 00:00:00 by ZaggyDad »

daniel.santos

  • Guest
(No subject)
« Reply #148 on: 27 March 2008, 11:29:00 »
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #149 on: 27 March 2008, 22:23:55 »
I networked a local game and it seems that sometimes it to rains on one and not the other.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/